Solved

creating outlook subfolder from server side inbox rule

Posted on 2011-03-14
4
1,606 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
[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 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

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

In-place Upgrading Dirsync to Azure AD Connect
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 …
In this video we show how to create a mailbox database 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 Servers >> Data…
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …

726 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