Set-Mailbox -ManagedFolderMailboxPolicy
I have a script that I run as a scheduled task on my Exchange 2007 server that does the following:Get-Mailbox -ResultSize unlimited | Set-Mailbox -ManagedFolderMailboxPolicy "Auto Deletion Policy" ManagedFolderMailboxPolicyAllowed -Confirm:$falseGet-mailboxdatabase "ms-exch-ccr01\ccr01db11" | Get-Mailbox | Set-Mailbox -ManagedFolderMailboxPolicy:$null ManagedFolderMailboxPolicyAllowed -Confirm:$falseWhatI am trying to do is to make sure that all usersEXCEPT for the users in the ms-exch-ccr01\ccr01db11 databaseare running the Auto Deletion Policy.The users in the ms-exch-ccr01\ccr01db11 database do not have a policy at all.Is there a better way to do this?
September 11th, 2009 5:52pm

This is fine, we can assign it with a single cmdlet also by filtering all users which are not on specific database but when mailbox movement happens from other database to specific database, it doesn't remove the policy so this looks perfect...Amit Tank | MVP Exchange Server | MCITP: EMA | MCSA: M | http://ExchangeShare.WordPress.com
Free Windows Admin Tool Kit Click here and download it now
September 11th, 2009 8:15pm

Great, Thank you!!
September 11th, 2009 9:57pm

ok, here is the problem i am running into. I run the above commands as a scheduled task, and i thought it was working well. But apparently it dosent always remove the policy from the users in the ccr01db11 database.so the policy ran anddeleted a bunch of e-mail that i dident want deleted.Either that or someone manually applied the policy.Two questions- are there logs created when the powershell cmdlets run? i could review them for the date in question.Is there a way to audit who applied the policy manually? Possibly an event id associated with the policy being applied to the user?
Free Windows Admin Tool Kit Click here and download it now
September 17th, 2009 2:46am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics