Apply new Manage Folder Mailbox Policy to entire datastore.
What is the Powershell command line to apply a Managed Folder Mailbox Policy to an entire datastore? Sorry for the newbie question.
Thanks!
Shawn
July 7th, 2008 7:13pm
I assume Managed Folder Mailbox Policy is created, you can use below command to set it for entire store.
Get-Mailbox | Where{$_.Database -eq "ServerName\StorageGroupName\DatabaseName"} | Set-Mailbox -ManagedFolderMailboxPolicy "Policy Name"
Explanation:
"Get-Mailbox" command gets the list of all mailboxes.
Where{$_.Database -like "ServerName\StorageGroupName\DatabaseName"} filter list of all mailboxes which are on mailbox store "Database Name" and output goes to Set-Mailbox command.
"Set-Mailbox" command set Managed folder policy for filtered mailboxes which are on "Database Name".
I hope this helps you...
Free Windows Admin Tool Kit Click here and download it now
July 7th, 2008 7:37pm
Amits answer is very solid, I only want to add a few points:
Just set the policy on DB isnt enough to see the effects in users Outlook. To do this we need to schedule the managed folder assistant to run on a mailbox server
For EMC:
a. Server Configuration->Mailbox->locate related mailbox role and right-click it->choose Properties
b. In the Messaging Records Management tab->set the running schedule
For EMS (perform a manual run immediately):
Start-ManagedFolderAssistant
http://technet.microsoft.com/en-us/library/bb691428(EXCHG.80).aspx
Here are some references about MRM:
Managing Messaging Records Management
http://technet.microsoft.com/en-us/library/bb123507(EXCHG.80).aspx
Records Management in Exchange Server 2007
http://msexchangeteam.com/archive/2006/09/19/428952.aspx
July 9th, 2008 5:44am
I am having a brain fart. When I enter this command into poweshell, it promps for me for Identity. What am I doing wrong? I just want to apply the mailbox policy to the entire database.
Thanks!
Shawn
Free Windows Admin Tool Kit Click here and download it now
August 14th, 2008 9:31pm
Hi Does this make it default for the datastore then, say I ran this command today then added new users next week, would I have to re-run the command or does it set it as default policy for the datastore? We are adding new users both individually and in bulk almost every week, it would be useful for us if the datastore had the policy set and every user added to that store afterwards would automatically pick up that policy. Cheers Phil
October 15th, 2009 2:18pm
did anyone ever answer this? i have read it will have to be incorporated into a PS1 file and set to run by scheduled task every week to catch all new users.. very clumbsy.... ALSO, no one has mentioned that in EXCH2003 when you shceduled the mailbox cleanup policy it was kicked off an ran until completed. This process you need to GUESS how long it needs to run to process all the mailboxes you intend to process... so it will need to have a schedule of several hours for thousands of mailboxes. again VERY VERY clumbsy...
none
Free Windows Admin Tool Kit Click here and download it now
January 10th, 2010 10:12pm
In case anyone searches and finds this post, here's an easy command to apply Policy to all users
Get-Mailbox | Set-Mailbox –ManagedFolderMailboxPolicy 'Default Managed Custom Folders'
March 7th, 2011 1:35pm