In Exchange 2007 and 2010, administrators can use the get-mailboxfolderstatistics cmdlet to get information about the folders in each mailbox on the server, from detailed information about the folders in a specific mailbox to general information about many mailboxes.
For example, use this cmdlet to get detailed information about each folder in a mailbox, including the number of items in the folder, the total size and the folder's path. (This can be useful when a user with hundreds of deeply nested folders can't find one.)
Get-MailboxFolderStatistics -Identity user1 >> c:\folders.txt
The results will be written to the text file in this format:
Date : 2/1/2011 10:00:00 PM
Name : Inbox
Identity : user1\Inbox
FolderPath : /Inbox
FolderId : [GUID]
FolderType : Inbox
ItemsInFolder : 2523
FolderSize : 74473907B
ItemsInFolderAndSubfolders : 3718
FolderAndSubfolderSize : 111559339B
OldestItemReceivedDate :
NewestItemReceivedDate :
ManagedFolder :
If you need a simple list of all folders in all mailboxes, use this cmdlet
get-mailboxdatabase | get-mailbox | get-mailboxfolderstatistics | ft identity,name >> c:\folders.txt
And the results will be formatted like this:
domain.com/Test/Alice A Harper\ Top of Information Store
domain.com/Test/Alice A Harper\C... Calendar
domain.com/Test/Alice A Harper\C... Contacts
domain.com/Test/Alice A Harper\D... Deleted Items
domain.com/Test/Alice A Harper\D... Drafts
domain.com/Test/Alice A Harper\I... Inbox
More Information
Get-MailboxFolderStatistics (TechNet)
hi
I wondered how to get the folder statistics for only users that have a mailbox over 2gb for example
You'll need to get a list of all of the large mailboxes then push the list to the folder stats cmdlet. Or, get all stats and sort them by size.