Convert the Get-MailboxStatistics output from Bytes to MB or GB in Exchange 2007.
Exchange 2003 Administrators are used to using the old Exchange Console to view the size of the mailboxes in your Exchange organization. The Exchange 2007 EMC unfortunately doesn’t have this feature anymore. Here’s a little PowerShell script that will translate the output of the Get-MailboxStatistics command from Bytes to MB or GB.
For a single user:
- Get-MailboxStatistics <USERNAME> | select-object DisplayName, {$_.TotalItemSize.Value.ToMB()}
- Get-MailboxStatistics <USERNAME> | select-object DisplayName, {$_.TotalItemSize.Value.ToGB()}
- Get-MailboxStatistics <USERNAME> | select-object DisplayName, {$_.TotalItemSize/1.0MB}
- Get-MailboxStatistics <USERNAME> | select-object DisplayName, {$_.TotalItemSize/1.0GB}
To get the script to work for all users just add the “Get-Mailbox” command.
For all users:
- Get-Mailbox | Get-MailboxStatistics | select-object DisplayName, {$_.TotalItemSize.Value.ToMB()}
To export to a csv:
- Get-Mailbox | Get-MailboxStatistics | select-object DisplayName, {$_.TotalItemSize.Value.ToMB()} | export-csv -path c:\path\filename.csv
With a little ingenuity you can really get creative on your output. For example, you could alter the Get-Mailbox command to limit your results to Mailbox Store or Server. How far will you go?
Leave a Reply
You must be logged in to post a comment.


(4 votes, average: 4.50 out of 5)

































