Exchange 2010: How to list folders in mailboxes (PS)

admin/ July 8, 2014/ Microsoft Exchange, PowerShell/ 0 comments

First store the output of the Get-Mailbox cmdlet in a variable. We do this to prevent piping errors when running multiple pipeline commands at the same time.

$mailboxes = Get-Mailbox

Run the following script to create a .csv file that contains ‘MailBox – # items in folder – folder size’.

$mailboxes | Select-Object alias | foreach-object {Get-MailboxFolderStatistics -Identity $_.alias | select-object Identity, ItemsInFolder, FolderSize} | Export-CSV C:\TEMP\MAILBOX_FOLDER_STATS.csv -NoTypeInformation

Leave a Comment

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>
*
*

three + 2 =