creating outlook subfolder from server side inbox rule
Posted on 2011-03-14
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?