Cloud

Weekly Exchange PowerShell Tip: Mailbox Sizes

​To get a formatted List with Mailbox Size in Megabytes (MB) to CSV File:
 
Get-Mailbox | Get-MailboxStatistics | Select-Object DisplayName,{$_.TotalItemSize.Value.ToMB()} | export-csv -path C:\<FILENAME>.csv

To get the Archive Size:
Get-Mailbox | Get-MailboxStatistics -Archive | Select-Object DisplayName,{$_.TotalItemSize.Value.ToMB()},Database | export-csv -path C:\<FILENAME>.csv

Alternatively you can specify the MBD also:

Get-MailboxDatabase -Identity "MB01 (FFB)" | Get-Mailbox | Get-MailboxStatistics | Select-Object DisplayName,{$_.TotalItemSize.Value.ToMB()} | export-csv -path C:\Temp\MailboxSize.csv
If you want the results output to the screen instead of a CSV:
Get-Mailbox | Get-MailboxStatistics | Format-Table DisplayName,{$_.TotalItemSize.Value.ToMB()} -auto

Leave a Reply