mailbox policy, help adding exclusions
When I first installed the exchange 2007 server I setup a mailbox policy to delete mail over 30 days old from inbox. There were two users who were exclusions to that rule. I forget how I excluded them and now I need to add more users to that exclusion. Is there any way to look that up?I probably ran some long command in the shell....How would you guys apply a policy to all users except about 5 while still having it be applied to new users with explicitly adding them?
August 11th, 2009 7:13am
Use gets all mailboxes in your organization and pipe only and pipe the output to set-mailbox command to set mailbox policy.Please see below discussion:http://social.technet.microsoft.com/Forums/en-US/exchangesvradmin/thread/1207bb32-6b15-49ac-9b4c-5dec5dc1380aAnil
Free Windows Admin Tool Kit Click here and download it now
August 11th, 2009 8:07am
Its all about the game of powershell, use filters on common parameters among the users you want to exclude and pipelines to setexclusions...Amit Tank | MVP Exchange Server | MCITP: EMA | MCSA: M | http://ExchangeShare.WordPress.com
August 11th, 2009 8:49am
Hi,Mailbox policy is applied to Individual User. You can use powershell script to create new mailbox and as part of the new-mailbox you can include -ManagedFolderMailboxPolicy and provide the policy name to apply policy to the newly created mailbox. Below is the sample exampleNew-Mailbox -Name $DName -Database $Database -UserPrincipalName $PrincipalName -FirstName $FName -LastName $LName -Alias $Aliasname -Password $passwd -ResetPasswordOnNextLogon $true -SamAccountName $Aliasname -ManagedFolderMailboxPolicy $MPolicy To make sure that you wanted to exclude few users always from the policy is may be you can try to create the dummy policy and add all the excluding users to aDLand use below command to apply a dummy policy which excludes from regular policyGet-DistributionGroupMember $group | Set-Mailbox -Identity -ManagedFolderMailboxPolicy $dummypolicyRegards,Krishnahttp://smtpport25.wordpress.com/
Free Windows Admin Tool Kit Click here and download it now
August 11th, 2009 10:04am
Or set ManagedFolderMailboxPolicy to $null to remove the applied policy from the members of DG...
Get-DistributionGroupMember $group | Set-Mailbox -Identity -ManagedFolderMailboxPolicy $NullAmit Tank | MVP Exchange Server | MCITP: EMA | MCSA: M | http://ExchangeShare.WordPress.com
August 11th, 2009 10:28am
So if i understand this correctly my steps would be:1. create distribution group called "excludedUsers" or something. 2. Add the users to be excluded from the policy to the group.3. Run Get-Mailbox -RecipientType UserMailbox | Set-Mailbox -ManagedFolderMailboxPolicy "Policy Name" -ManagedFolderMailboxPolicyAllowed4. Run Get-DistributionGroupMember excludedUsers | Set-Mailbox -Identity -ManagedFolderMailboxPolicy $Nulland this would apply it to every user mailbox and then exclude it from those in that group, correct? and then as I add or remove users from the excluded group I don't need to re-run those powershell command, correct?
Free Windows Admin Tool Kit Click here and download it now
August 13th, 2009 12:17am
Hi, Q: This would apply it to every user mailbox and then exclude it from those in that group, correct?A: YesQ: Then as I add or remove users from the excluded group I don't need to re-run those powershell command, correct?A: No, you need to run the two commands again to add/delete policy to the mailbox. Thanks,Mike
August 13th, 2009 10:10am
Hi, Any further question regarding the issue?Thanks,Mike
Free Windows Admin Tool Kit Click here and download it now
August 17th, 2009 9:55am
Nope. that seemed to work well. Just so others who might try this know, the command above didn't need the -Identity so itsGet-DistributionGroupMember excludedUsers | Set-Mailbox -ManagedFolderMailboxPolicy $Null
August 17th, 2009 6:13pm