?
Solved

creating outlook subfolder from server side inbox rule

Posted on 2011-03-14
4
Medium Priority
?
1,610 Views
Last Modified: 2012-05-11
Hi guys,

With your help I already successfully created following rule:

new-inboxrule -name "eBrochure" -mailbox USER -MoveToFolder "USER:\eBrochure" -SubjectContainsWords "eBrochure:"

and it works pretty good. The question is: can I create a rule which will recreate the folder eBrochure if it is not exist in the receipient mailbox. Right now I'm getting error on the rule if it is no subfolder eBrochure on user's mailbox. I was using MAPILab Server side rules on my old Exchange 2003 servers and when Rule is in place and tagged email delivered to the mailbox - eBrochure subfolder recreated if user accidentaly deleted.

I already have custom managed folder eBrochure with applied retention policy on my new Exchange 2010 SP1 servers.

Please advice. Thank you in advance.

P.S. I found an alternative way via VBS logon script:

Set objOutlook = CreateObject("Outlook.Application")
Set myNameSpace = objOutlook.GetNamespace("MAPI")
Set myInboxFolder = myNameSpace.GetDefaultFolder(6)
Set myNewFolder = myInboxFolder.Folders.Add("eBrochure")

How to make it exit without the error if the folder already exist?
0
Comment
Question by:Armen Minasyan
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 49

Accepted Solution

by:
Akhater earned 2000 total points
ID: 35135303
on error resume next
Set objOutlook = CreateObject("Outlook.Application")
Set myNameSpace = objOutlook.GetNamespace("MAPI")
Set myInboxFolder = myNameSpace.GetDefaultFolder(6)
Set myNewFolder = myInboxFolder.Folders.Add("eBrochure")
0
 

Author Comment

by:Armen Minasyan
ID: 35137779
I modified it a little bit if someone needed - changed the subfolder location from Inbox into Mailbox itself:

On Error Resume Next
Set objOutlook = CreateObject("Outlook.Application")
Set myNameSpace = objOutlook.GetNamespace("MAPI")
Set myInboxFolder = myNameSpace.Folders(1)
Set myNewFolder = myInboxFolder.Folders.Add("eBrochure")
0
 
LVL 49

Expert Comment

by:Akhater
ID: 35137800
so did my "On error resume Next" did the trick ?
0
 

Author Comment

by:Armen Minasyan
ID: 35138158
Yes, it did. Thanks for your help!
0

Featured Post

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Unified and professional email signatures help maintain a consistent company brand image to the outside world. This article shows how to create an email signature in Exchange Server 2010 using a transport rule and how to overcome native limitations …
There are times when we need to generate a report on the inbox rules, where users have set up forwarding externally in their mailbox. In this article, I will be sharing a script I wrote to generate the report in CSV format.
The video tutorial explains the basics of the Exchange server Database Availability groups. The components of this video include: 1. Automatic Failover 2. Failover Clustering 3. Active Manager
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Suggested Courses
Course of the Month11 days, 18 hours left to enroll

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question