Export a list of all mailboxes in Exchange using PowerShell including sizes and which database they reside on

This is a just a quick post to show an example of the Get-MailboxStatistics command in Microsoft Exchange.  This command is useful if you want to pull off information about your user’s mailboxes including size, mailbox database and other attributes.

In its simplest form he command is:

Get-MailboxDatabase | Get-MailboxStatistics | Export-CSV c:\temp\mailboxdata.csv


This will just output all information about all of your user’s mailboxes:

Export a list of all mailboxes in PowerShell in Exchange including sizes and which database they reside on

You can then be more specific about the data you want to output using any of the fields from the first command and put it in an order:

Get-MailboxStatistics -Database "Mailbox DB01" | Select DisplayName, ItemCount, TotalItemSize | Sort-Object TotalItemSize -Descending | Export-CSV c:\temp\mailboxdata.csv


You can just leave out the database parameter if you want information on all mailbox databases:

Get-MailboxDatabase | Get-MailboxStatistics | Select DisplayName, ItemCount, TotalItemSize | Sort-Object TotalItemSize -Descending | Export-CSV c:\temp\mailboxdata.csv


Leave a Reply

Your email address will not be published. Required fields are marked *