Powershell to get the list of Disconnected mailbox in the Exchange Server

If we delete a user account then it will automatically disconnects mailbox from the account and adds to Disconnected Mailbox list. Mailbox  will be listed until retention period of 30 days

Get-MailboxStatistics -server <servername> | where { $_.DisconnectDate -ne $null } | select DisplayName,MailboxGuid,Database,DisconnectDate

Gets the list of Disconnected mailbox in the specified Exchange 2007 Server

 

Get-MailboxStatistics  | where { $_.DisconnectDate -ne $null } | select DisplayName,MailboxGuid,Database,DisconnectDate

Gets the list of Disconnected mailbox on the Exchange 2007  maibox server where you are running this command

Powershell to get top 100 mailboxes in the Exchange 2007 server

Below Powershell script gets you the top 100 mailboxes from an Exchange 2007 server in the sorted format

Get-MailboxStatistics |sort totalitemsize -des | select-object Displayname, ItemCount,@{name=’TotalItemSize(MB)’;expression={$_.totalitemsize/1MB}}  -first 100

Top address 100 mailbox in the specific Exchange server. You can always modify the count as per your requirement. -first xxx has to modified to get the expected count result.

$MailboxServer = <servername>

Get-MailboxStatistics | ?{$_.ServerName -eq $MailboxServer }|sort totalitemsize -des | select-object Displayname, ItemCount,@{name=’TotalItemSize(MB)’;expression={$_.totalitemsize/1MB}}  -first 100

 

Below powershell will get the list of top 10 mailbox from the specific Exchange database or Store

$database = <database>
Get-MailboxStatistics | ?{$_.Database -eq $database}|sort totalitemsize -des | select-object Displayname, ItemCount,@{name=’TotalItemSize(MB)’;expression={$_.totalitemsize/1MB}}  -first 10

Setting Mailbox Quota Limits in Exchange 2007 throught Powershell

Command to set MailBox Quota limits on all the stores in Exchange 2007  environment.

Get-Mailboxdatabase | Set-mailboxdatabase -ProhibitSendReceiveQuota 2GB -ProhibitSendQuota 1GB -IssueWarningQuota 900MB

 

Command to set Mailbox Quota limits on all the stores on the specific exchange server

Get-Mailboxdatabase -server $Server | Set-mailboxdatabase -ProhibitSendReceiveQuota 2GB -ProhibitSendQuota 1GB -IssueWarningQuota 900MB

 

Command to set Mailbox Quota limits on all the stores on the specific exchange server except on the specific store

$Server =<ExchagneServername>
$DB =<Databasename>
Get-mailboxdatabase -server $Server | Where {$_.Name -ne $DB} | Set-mailboxdatabase -ProhibitSendReceiveQuota 2GB -ProhibitSendQuota 1GB -IssueWarningQuota 900M
 

 

Powershell Command to set Mailbox Quota limits on a specific store in a given Exchagne 2007 server

$Server =<ExchagneServername>
$DB =<Databasename>
Get-mailboxdatabase -server $Server | Where {$_.Name -eq $DB} | Set-mailboxdatabase -ProhibitSendReceiveQuota 2GB -ProhibitSendQuota 1GB -IssueWarningQuota 900M

Powershell command to set Exchange WarningMailbox, ProhibitSendMailbox, ProhibitSendReceiveMailbox Warning Messages for Exchange 2007

Please find the below commands to set Custom Quota Messages for Warning, ProhibitSendMailbox and ProhibitSendReceiveMailBox, Just change the require custom message and apply the same.

New-SystemMessage -QuotaMessageType WarningMailbox -Language EN -Text “Your Custom Message”

New-SystemMessage -QuotaMessageType ProhibitSendMailbox -Language EN -Text “Your Custom Message”

New-SystemMessage -QuotaMessageType ProhibitSendReceiveMailBox -Language EN -Text “Your Custom Message”