Solved

creating outlook subfolder from server side inbox rule

Posted on 2011-03-14
4
1,592 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:aramagedon
  • 2
  • 2
4 Comments
 
LVL 49

Accepted Solution

by:
Akhater earned 500 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:aramagedon
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:aramagedon
ID: 35138158
Yes, it did. Thanks for your help!
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Local Continuous Replication is a cost effective and quick way of backing up Exchange server data. The following article describes the steps required to configure Local Continuous Replication. Also, the article tells you how to restore from a backup…
Following basic email etiquette rules will help you write a professional email and achieve a good, lasting impression with your contacts.
In this video we show how to create an Address List in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Organization >> Ad…
In this Micro Video tutorial you will learn the basics about Database Availability Groups and How to configure one using a live Exchange Server Environment. The video tutorial explains the basics of the Exchange server Database Availability grou…

760 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now