Jun 19 2014

Export mailbox sizes in Exchange 2010 using Exchange Management Shell

Thought I’d share two scripts today. I use both daily to export mailbox sizes to a csv file for reporting purposes.

These scripts will export the following:

User Display Name, Database where the mailbox is homed ,the mailbox’s  Total Item Size, Item Count in the mailbox and the Storage Limit Status

Export a report on mailbox sizes on a specific server:

Get-Mailbox –Server the server name –ResultSize Unlimited | Get-MailboxStatistics | Select-Object DisplayName, Database, TotalItemSize, ItemCount, StorageLimitStatus | Sort TotalItemSize, -Ascending | Export-CSV driveletter:\foldername\reportname.csv

Export a report for mailboxes homed on all your mailbox servers:

Get-ExchangeServer -Domain your domain name | Get-MailboxStatistics | sort TotalItemSize -Descending | select DisplayName, Database, StorageLimitStatus, @{label=”Total Size (MB)”;expression={$_.TotalItemSize.Value.ToMB()}}, @{label=”Deleted Item Size (MB)”;expression={$_.TotalDeletedItemSize.Value.ToMB()}} | epcsv driveletter:\foldername\reportname.csv

Obviously change -Ascending to -Descending so that the output is to your liking.

Aug 12 2011

Export Mailbox sizes per server to csv (Exchange 2003)

If you need a rather quick way to export all the mailbox sizes on a particular server then the below link is for you.

Download the script, run it by opening the command prompt and type cscript MSX_GetMailboxSize.vbs thenameoftheserverhostingthemailboxes>filenameyouwanttochoose.csv

Remember to add the export location to the above command if you want to save the export to a particular path ie: cscript MSX_GetMailboxSize.vbs servername>e:reportsserver1.csv

Open the csv export with Excel after you ran the script. You can then manipulate the contents to the format you need as all mailbox data will be there.

Fields exported to csv using this script are:

Display Name
Storage Group
Total Items

I used this to work out an average mailbox usage per server.

I found the script here. There’s also more information on this script from the source site.

Hope this has been helpful.