list folders for all exchange mailboxes
What command do I run to view all mailboxes folder structure? I want to see the folders in everyones mailbox, the size of each folder, and the size of the mailbox. Then output the entire list to a file. Thanks,SJMP
December 15th, 2009 4:23pm

Which version of MS Exchange are you using?
Free Windows Admin Tool Kit Click here and download it now
December 15th, 2009 5:57pm

Exchange 2007 (sorry that is helpful)I can use get-mailbox identity | get-mailboxstatisticsbut this is per user and gives to much info for each folder. I am looking formailbox / folder list / item count I want to produce a list for all users in the Storage Group I am working on. And output this to a xls/ csv file. thanks,
December 15th, 2009 7:35pm

Please use Get-MailboxFolderStatistics cmdlet. Heres also a good sampleJames Luo TechNet Subscriber Support (http://technet.microsoft.com/en-us/subscriptions/ms788697.aspx) If you have any feedback on our support, please contact tngfb@microsoft.com
Free Windows Admin Tool Kit Click here and download it now
December 16th, 2009 5:58am

James Thank you very helpful.
December 16th, 2009 5:31pm

To output the results of the Get-MailboxFolderStatistics cmdlet to a CSV file pipe (|) to the Export-Csv cmdlet.
Free Windows Admin Tool Kit Click here and download it now
December 16th, 2009 5:33pm

James - output is notworking properlyHere is my cmd[PS] get-mailboxdatabase | get-mailbox -resultsize unlimited | Get-MailboxFolderStatistics -folderscope all | Sort-Object TotalItemSize -Descending | ft DisplayName,@{label="TotalItemSize(MB)";expression={$_.TotalItemSize.Value.ToMB()}},ItemCount | Export-csv -path C:\1216_1.csv #TYPE Microsoft.PowerShell.Commands.Internal.Format.FormatStartData ClassId2e4f51ef21dd47e99d3c952918aff9cd pageHeaderEntry pageFooterEntry autosizeInfo shapeInfo 033ecb2bc07a4d43b5ef94ed5a35d280 Microsoft.PowerShell.Commands.Internal.Format.TableHeaderInfo 9e210fe47d09416682b841769c78b8a3 27c87ef9bbda4f709f6b4002fa4af63c 27c87ef9bbda4f709f6b4002fa4af63c 27c87ef9bbda4f709f6b4002fa4af63c 27c87ef9bbda4f709f6b4002fa4af63c 27c87ef9bbda4f709f6b4002fa4af63c 27c87ef9bbda4f709f6b4002fa4af63c 27c87ef9bbda4f709f6b4002fa4af63c 27c87ef9bbda4f709f6b4002fa4af63c 27c87ef9bbda4f709f6b4002fa4af63c 27c87ef9bbda4f709f6b4002fa4af63c 27c87ef9bbda4f709f6b4002fa4af63c 27c87ef9bbda4f709f6b4002fa4af63c
December 16th, 2009 6:08pm

Try: |Export-Csv c:\C:\1216_1.csv (without the "-path" option)
Free Windows Admin Tool Kit Click here and download it now
December 16th, 2009 7:18pm

same thing
December 16th, 2009 7:28pm

On Wed, 16-Dec-09 15:08:32 GMT, SJMP wrote:>James - output is notworking properlyHere is my cmd[PS] get-mailboxdatabase | get-mailbox -resultsize unlimited | Get-MailboxFolderStatistics -folderscope all | Sort-Object TotalItemSize -Descending | ft DisplayName,@{label="TotalItemSize(MB)";expression={$_.TotalItemSize.Value.ToMB()}},ItemCount | Export-csv -path C:\1216_1.csvWell, for one thing, the Get-MailboxFolderStatistics output doesn'tcontain a "DisplayName", "ItemCount", or "TotalItemSize" property.ur FT command is going to produce gibberish.Second, I think you really want a Select-Object where you have theFormat-Table.Third, the Get-MailboxDatabase is superfluous unless you want to limitthe mailboxes you're reporting on.See if this produces something closer to what you want:get-mailbox -resultsize unlimited | Get-MailboxFolderStatistics-folderscope all | Sort-Object FolderSize -Descending | selectIdentity,@{name='TotalItemSize(MB)';expression={$_.FolderSize.ToMB()}},ItemsInFolderThe "Identity" column is going to produce some ugly looking name.---Rich MatheisenMCSE+I, Exchange MVP--- Rich Matheisen MCSE+I, Exchange MVP
Free Windows Admin Tool Kit Click here and download it now
December 16th, 2009 8:39pm

Does Rich's suggestion work?James Luo TechNet Subscriber Support (http://technet.microsoft.com/en-us/subscriptions/ms788697.aspx) If you have any feedback on our support, please contact tngfb@microsoft.com
December 18th, 2009 4:32am

Please add “ft -wrap” after the cmdlet from Rich, which will make the folder name lookable James Luo TechNet Subscriber Support (http://technet.microsoft.com/en-us/subscriptions/ms788697.aspx) If you have any feedback on our support, please contact tngfb@microsoft.com
Free Windows Admin Tool Kit Click here and download it now
December 21st, 2009 4:31am

Thanks guys but still getting gibberish when exporting to csv. I tried:get-mailbox -resultsize unlimited | Get-MailboxFolderStatistics -folderscope all | Sort-Object FolderSize -Descending | select Identity,@{name='TotalItemSize(MB)';expression={$_.FolderSize.ToMB()}},ItemsInFolder | ft -wrap | export-csv c:\folder_stats.csvTHe output in PS is fine, but when I export it to csv i still get 27c87ef9bbda4f709f6b4002fa4af63c 27c87ef9bbda4f709f6b4002fa4af63c 27c87ef9bbda4f709f6b4002fa4af63c 27c87ef9bbda4f709f6b4002fa4af63c 27c87ef9bbda4f709f6b4002fa4af63c 27c87ef9bbda4f709f6b4002fa4af63c 27c87ef9bbda4f709f6b4002fa4af63c 27c87ef9bbda4f709f6b4002fa4af63c
December 29th, 2009 6:00pm

On Tue, 29-Dec-09 15:00:06 GMT, SJMP wrote:>>>Thanks guys but still getting gibberish when exporting to csv. I tried:get-mailbox -resultsize unlimited | Get-MailboxFolderStatistics -folderscope all | Sort-Object FolderSize -Descending | select Identity,@{name='TotalItemSize(MB)';expression={$_.FolderSize.ToMB()}},ItemsInFolder | ft -wrap | export-csv c:\folder_stats.csvTHe output in PS is fine, but when I export it to csv i still get Remove the Format-Table part and you'll be okay.---Rich MatheisenMVP--- Rich Matheisen MCSE+I, Exchange MVP
Free Windows Admin Tool Kit Click here and download it now
December 30th, 2009 5:19am

That was it Rich Thanks.
January 5th, 2010 4:21pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics