Monday, August 6, 2012

Apply Recipient Limits on a Database level in Exchange2010


Steps to apply a Recipient Policy @ database level in Exchange2010:

Below command is used to export all the details of Mailboxes in a Specific DB to .csv file. It will shows the details of Alias, recipient limits, prohit etc. as it shows down.

How to run the command in EMS: Copy this command in a notepad & make it to a oneline & run this command, then only it works like charm.


[PS] C:\Windows\system32>Get-Mailbox -Database "DefaultMailboxDB" | sort-object | Select-Object name,alias,RecipientLimits,servername,ProhibitSendQuota,IssueWarningQuota,MaxReceiveSize,MaxSendSize,DisplayName,Database,PrimarySmtpAddress,ProhibitSendReceiveQuota,@{n="Size(KB)";e = {$MBXstat = Get-MailboxStatistics $_.name; $MBXstat.totalItemsize}},@{n="Items"; e = {$MBXstat = Get-MailboxStatistics $_.name ; $MBXstat.itemcount; $MBXstat.storageLimitStatus}} | Export-Csv C:\MailboxSize_output.csv


This comnad will apply the recipient limit to 30 only to all the mailboxes located in a mentioned DB
[PS] C:\Windows\system32>Get-Mailbox -Database "DefaultMailboxDB" | Set-Mailbox -RecipientLimits "30"

If you want to exclude one mailbox from above database, run below command;
Set-Mailbox "attendance" -RecipientLimits "500"

Below command shows details of specific mailbox only;
Get-Mailbox -Identity attendance |fl

No comments:

Post a Comment