Link to home
Start Free TrialLog in
Avatar of tpaukovits
tpaukovitsFlag for United States of America

asked on

Exchange 2007 Managed Folder Mailbox Policy

In Exchange 2007 SP1, I have multiple Managed Folder Mailbox Policies.  I would like to be able to run an Exchange Shell command to get all the mailboxes with a certain policy i.e., get-mailbox | get-managedfoldermailboxpolicy "default policy" | ft .  However this does not work nor can I get any command to spit out the mailbox policy assoicated with a particular mailbox.

This can be done in the EMC GUI interface by using the filter.  Any idea how to do this with the shell i.e., even get a list of all the mailboxes with a policy.
ASKER CERTIFIED SOLUTION
Avatar of tigermatt
tigermatt
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
For everyone on a server:
Get-mailbox -server <servername> | set-mailbox -ManagedFolderMailboxPolicy <policyName>
 
For everyone on a database:
Get-mailbox -database <DB Name> | set-mailbox -ManagedFolderMailboxPolicy <policyName>
 
For Everyone in an OU:
Get-mailbox -OrganizationalUnit <OU Name> | set-mailbox -ManagedFolderMailboxPolicy <policyName>

For everyone in a DG:
Get-distributionGroupMember <DG name> | set-mailbox -ManagedFolderMailboxPolicy <policyName>
 
For everyone with a particular custom attribute set:
Get-mailbox | where {$_.CustomAttribute1 -eq "<vip>"} | set-mailbox -ManagedFolderMailboxPolicy "Policy name"
http://exchangeserverinfo.com/2009/08/14/how-to-cmdlets.aspx 

Just as a point of note, the comment from the previous expert will set policies on a series of users but won't actually report who has which policy already applied.

Also, Exchange Management Shell will throw a warning each time you apply a managed folder policy, warning that older versions of Outlook may not be fully compatible with the policies applied. If setting managed folder policies en masse, you'd need to add the -ManagedFolderMailboxPolicyAllowed switch to the Set-Mailbox cmdlet to avoid this.

-Matt
Avatar of tpaukovits

ASKER

Great.  so when I pipe this out (Get-Mailbox -resultsize unlimited | where {$_.ManagedFolderMailboxPolicy -eq "Default Policy"}
) to a txt file I see with the following columns...
Name                      Alias                ServerName       ProhibitSendQuota

Eventhough the results of this command only shows a specifc mailbox policy, how do I get a column called "ManagedFolderMailboxPolicy" to reflect the specific policy.  I assume I would use a select statement?  any help here
thanks a lot.  Great stuff so far....
got it...Get-Mailbox | where {$_.ManagedFolderMailboxPolicy -eq "Defaul
t User Mailbox Policy"} | select displayname,database,managedfoldermailboxpolicy | ft > c:\test5

Thanks for your help.  Worked like a charm.

Troy
Great response with enough detail.

A select statement would work, or you could use format-table (which can be shortened to simply 'ft').

For example:

Get-Mailbox -resultsize unlimited | Where {$_.ManagedFolderMailboxPolicy -eq "Default Policy"} | select name, ManagedFolderMailboxPolicy

or,

Get-Mailbox -resultsize unlimited | Where {$_.ManagedFolderMailboxPolicy -eq "Default Policy"} | ft name, ManagedFolderMailboxPolicy

Both those commands will produce exactly the same result; it's just down to personal preference whether you use ft (format-table) or select.

-Matt
Got there before me! Glad you worked it out :)