I often need to get statistics and check mailbox sizes and quotas and here are some useful notes and examples that I often cut’n’paste instead of re-inventing them:

Get top list of big mailboxes, sorted by size:

Get-Mailbox -ResultSize Unlimited | Get-MailboxStatistics | Sort-Object TotalItemSize -Descending | Select-Object DisplayName,StorageLimitStatus,TotalItemSize -First 100  | Sort-Object TotalItemSize

Find those who have reached their quota already:

Get-Mailbox -Resultsize Unlimited | Get-MailboxStatistics | where {$_.StorageLimitStatus -eq “IssueWarning”}
Get-Mailbox -Resultsize Unlimited | Get-MailboxStatistics | where {$_.StorageLimitStatus -eq “ProhibitSend”}

Or combine them both:

Get-Mailbox -Resultsize Unlimited | Get-MailboxStatistics  | where {($_.StorageLimitStatus -contains “ProhibitSend”) –or ($_.StorageLimitStatus -contains “IssueWarning”)}

Set new quota to issue warning at 8 GB and issue send at 8.5 GB.

Set-Mailbox <mailbox> -UseDatabaseQuotaDefaults $false -IssueWarningQuota 8GB -ProhibitSendQuota 8.5GB

You might have seen that even though you change the quota, the change does not take place immediately. See this article for more information.

To get some information on the size of the Archive mailboxes:

Get-Mailbox | Get-MailboxStatistics -Archive -ErrorAction SilentlyContinue | ft DisplayName,TotalItemSize

Let me know if you need some more examples and I’ll keep adding them.