Home  |  Services  |  About Us  |  Contact  | 

 

Brad's TechTips - Exchange Server & Outlook

[<< Full list of Exchange Server & Outlook tips.]
 
 
Exchange Server 2007: Display a List of Mailboxes and Their Corresponding Sizes
 
Exchange 2007 does not have the same mailbox size view that Exchange 2003/2000 has. To create a listing of mailboxes and their respective sizes, run the following command in the Exchange Management Shell.  (The command should be run on a single line of text.)
 
get-mailboxstatistics -verbose | sort-object totalitemsize -descending |
format-table totalitemsize, displayname >c:\temp\output.txt


The results will be created in a file at c:\temp\output.txt.

CREDIT:
(Special thanks to Gabriele Tansini, Senior Field Engineer in Exchange Server at Microsoft, for providing the syntax for this command.)


 
Exchange Server 2010 and 2007: Display a List of Mailboxes and Their Corresponding Sizes
 
The command below will run in Exchange 2010 as well as 2007.  It will create a listing of mailboxes and their respective sizes, sorted by descending size, and also include the item count, size of the Deleted Items folder and count of items in Deleted Items.  Run the command in the Exchange Management Shell on a single line of text.
 
Get-Mailbox -ResultSize Unlimited | Get-MailboxStatistics | Select DisplayName,@{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 >c:\temp\mailbox.txt

The results will be created in a file at c:\temp\output.txt.
 
For a simpler view, such as Name sorted alphabetically and including only the overall mailbox size, use the following:
Get-Mailbox -ResultSize Unlimited | Get-MailboxStatistics | Select DisplayName,@{name="TotalItemSize (MB)";expression={[math]::Round((($_.TotalItemSize.Value.ToString()).Split("(")[1].Split(" ")[0].Replace(",","")/1MB),2)}} | Sort "DisplayName" >c:\temp\mailbox.txt