How do we find out which mailboxes are using most space on an Exchange Server/Database?

Get-MailboxDatabase Server\Database | Get-Mailbox -ResultSize Unlimited | Get-MailboxStatistics |Sort-Object TotalItemSize -Descending | Select-Object DisplayName,TotalItemSize,Database -First 10 | ConvertTo-Html -Title “Top 10 users in Database1” > C:\Database.htm

The above command will:

  • Get the list of all the mailboxes in a particular database
  • Sort them by size
  • Extract the Display Name, Size and Database information
  • Pick the first 10 from the list
  • Save the information in an HTM file.

Find the same information for a Server.
Get-MailboxServer ServerName | Get-MailboxDatabase | Get-Mailbox -ResultSize Unlimited | Get-MailboxStatistics |Sort-Object TotalItemSize -Descending | Select-Object DisplayName,TotalItemSize,Database -First 10

Display information about all the mailboxes on a server and provide the output in Mega Bytes.
Get-MailboxDatabase Server\Database | Get-Mailbox -ResultSize Unlimited | Get-MailboxStatistics |Sort-Object TotalItemSize -Descending | ft DisplayName,@{label=”Total Size (MB)”;expression={$_.TotalItemSize.Value.ToMB()}},database | more

Hope this helps.

-Thanks, Jinesh.

Advertisements