Categories
Exchange Server 2007

Exchange 2007 : Mailbox Statistics and Storage Quotas

Exchange 2007 : Mailbox Statistics and Storage Quotas

Usethe following Exchange Shell command to list all mailboxes, sorted by size

get-mailbox | Get-MailboxStatistics |  Select @{n=”DisplayName”;e={$_.DisplayName}}, StorageGroupName,@{e={$_.TotalDeletedItemSize.Value.ToMB()};n=”TotalDeletedItemsSize(MB)”}, DeletedItemCount, @{e={$_.TotalItemSize.Value.ToMB()};n=”TotalItemSize(MB)”}, ItemCount, StorageLimitStatus | Sort-Object “TotalItemSize(MB)” | ft

Use the following command to list all mailboxes with a StorageQuotaStatus of ‘ProhibitSend’

get-mailbox  | Get-MailboxStatistics | where-object {$_.StorageLimitStatus -eq “ProhibitSend”} |  Select @{n=”DisplayName”;e={$_.DisplayName}}, StorageGroupName,@{e={$_.TotalDeletedItemSize.Value.ToMB()};n=”TotalDeletedItemsSize(MB)”}, DeletedItemCount, @{e={$_.TotalItemSize.Value.ToMB()};n=”TotalItemSize(MB)”}, ItemCount, StorageLimitStatus | Sort-Object “TotalItemSize(MB)” | ft

Alternately you can export the results to a CSV file using the following command:

get-mailbox | Get-MailboxStatistics | where-object {$_.StorageLimitStatus -eq “ProhibitSend”} |  Select @{n=”DisplayName”;e={$_.DisplayName}}, StorageGroupName,@{e={$_.TotalDeletedItemSize.Value.ToMB()};n=”TotalDeletedItemsSize(MB)”}, DeletedItemCount, @{e={$_.TotalItemSize.Value.ToMB()};n=”TotalItemSize(MB)”}, ItemCount, StorageLimitStatus | Sort-Object “TotalItemSize(MB)” | Export-Csv C:\mailbox_stats.csv

The following options are available as StorageQuotaStatus:

  • IssueWarning
  • BelowLimit
  • ProhibitSend
  • MailboxDisabled
  • NoChecking

Simply modifiy the command as follows to change the data returned by the command:

get-mailbox | Get-MailboxStatistics | where-object {$_.StorageLimitStatus -eq “IssueWarning“} |  Select @{n=”DisplayName”;e={$_.DisplayName}}, StorageGroupName,@{e={$_.TotalDeletedItemSize.Value.ToMB()};n=”TotalDeletedItemsSize(MB)”}, DeletedItemCount, @{e={$_.TotalItemSize.Value.ToMB()};n=”TotalItemSize(MB)”}, ItemCount, StorageLimitStatus | Sort-Object “TotalItemSize(MB)” | Export-Csv C:\mailbox_stats.csv

Leave a Reply

Your email address will not be published. Required fields are marked *