How do I export user mailbox information to Excel?
Exporting mailbox information from Exchange server 2010 has been possible and task has become easier with the addition of the Get-Mailbox and Get-MailboxStatistics commands in – the PowerShell module. In this article, I’ll show you how to extract mailbox information and export the data to an Excel spreadsheet.
Logon to Exchange server 2010 and open the exchange powershell and perform the below command for check the mailbox size for single user.
Get-MailboxStatistics riyazahamed | ft DisplayName, TotalItemSize, ItemCount
If you need to extract the mailbox information for entire user in the organization. The below command achieve your requirements and will export as output.CSV on the specified location.
Get-Mailbox -ResultSize Unlimited | Get-MailboxStatistics | Select DisplayName,StorageLimitStatus,@{name="TotalItemSize (MB)";expression={[math]::Round((($_.TotalItemSize.Value.ToString()).Split("(")[1].Split(" ")[0].Replace(",","")/1MB),2)}},@{name="TotalDeletedItemSize (MB)";expression={[math]::Round((($_.TotalDeletedItemSize.Value.ToString()).Split("(")[1].Split(" ")[0].Replace(",","")/1MB),2)}},ItemCount,DeletedItemCount | Sort "TotalItemSize (MB)" -Descending | Export-CSV "C:\output.csv" -NoTypeInformation
Important Note: Please understand the risks before using it.