Posts Tagged ‘sorted by size’

Export Exchange 2007 Mailbox Users Sorted By size

Tuesday, November 20th, 2012

Let’s say you need to run a report in Exchange 2007 containing the following items:

  • AD Display Name
  • Mailbox Size
  • Mailbox Item Count
  • Current Storage Limit (if applicable)

And you need this list sorted by Mailbox Size, descending, you would run the following command in Exchange Management Shell, on the Exchange 2007 server, using AD/Exchange admin rights:

Get-MailboxStatistics | where {$_.ObjectClass –eq “Mailbox”} | Sort-Object TotalItemSize –Descending | ft @{label=”User”;expression={$_.DisplayName}},@{label=”Total Size(MB)”;expression={$_.TotalItemSize.Value.ToMB()}},@{label=”Items”;expression={$_.ItemCount}},@{label=”StorageLimit”;expression={$_.StorageLimitStatus}} -auto >c:\mx_size_report.txt

The above will output to a txt file called “mx_size_report.txt”

Let’s say you want to view this in Excel, simply open Excel and import this TXT file.  You will now have an Excel manageable file with the report values you just generated.