Export list of Exchange mailboxes and/or addresses

You may at some point want to get a list of all the mailboxes defined on your mail server, along with other details (such as additional email addresses) for each.

From Exchange 2007 SP1 onwards there is an export list option in the Exchange Management Console (EMC). You can define your view how you see fit (filtered if required) and then export the list – selecting columns that you wish to see. More details can be found on the MSExchange.org website.

Alternatively, PowerShell can do the job with a single command:
Get-Mailbox -ResultSize Unlimited |Select-Object DisplayName,ServerName,PrimarySmtpAddress, @{Name=”EmailAddresses”;Expression={$_.EmailAddresses |Where-Object {$_.PrefixString -ceq “smtp”} | ForEach-Object {$_.SmtpAddress}}} | Export-Csv C:\ExportList.csv -NoTypeInformation

Have a look at the comments on this page of Karl Mitschke’s site for a myriad of other variations on the theme.

Addendum: For a simple list of all mailboxes, sorted by decreasing size, run this command:

Get-MailboxDatabase | Get-MailboxStatistics | Sort totalitemsize -desc | Select-Object displayname, totalitemsize, itemcount | export-csv C:\temp\AllMailboxes.csv

Related Posts

Need IT Help?

If you need assistance please feel free to reach out to us.