Exchange Server 2010 – Get a List of Mailboxes by Size

In the Exchange Management Shell, to get a simple list of mailboxes sorted by size, in descending order:

Get-Mailbox | Get-MailboxStatistics | Sort-Object TotalItemSize -descending | ft DisplayName,TotalItemSize -autosize

Now let’s dig a little deeper and show each mailbox’s storage quota limit status and display the total count of email messages as well:

Get-Mailbox | Get-MailboxStatistics | Sort-Object TotalItemSize -descending | ft DisplayName,StorageLimitStatus,ItemCount,TotalItemSize -autosize

Ok, now lets see the display name, storage quota limit status, count, and size of the user’s overall mailbox, plus their deleted items folder too:

Get-Mailbox | Get-MailboxStatistics | Sort-Object TotalItemSize -descending | ft DisplayName,StorageLimitStatus,DeletedItemCount,TotalDeletedItemSize,ItemCount,TotalItemSize -autosize

Yuck, that’s a lot of information to try and fit into a tiny ass window, how about just showing all the pack rats who need to empty their damn trash instead:

Get-Mailbox | Get-MailboxStatistics | Sort-Object TotalDeletedItemSize -descending | ft DisplayName,DeletedItemCount,TotalDeletedItemSize -autosize

Lastly, let’s just find all the people who don’t take their storage quotas seriously and need reprimanded:

Get-Mailbox | Get-MailboxStatistics | Where-Object {$_.StorageLimitStatus -match 'IssueWarning|ProhibitSend|MailboxDisabled'} | Sort-Object TotalItemSize -descending | ft DisplayName,DeletedItemCount,TotalDeletedItemSize,ItemCount,TotalItemSize -autosize

Leave a Reply