Exchange 2010 : Deleted Items Folder Size Report

Exchange 2010 : Deleted Items Folder Size Report

The following script can be used to report on user mailbox “Deleted Items” folder sizes (and sub folders). It will create a CSV file in the directory from which the script is executed.

{code lang:php title:”Mailbox Deleted Items Folder Size Report” lines:false hidden:false}$data = @()
foreach($mbx in Get-MailboxDatabase | Get-Mailbox)
{
$dispname = $mbx.displayName
$data += Get-MailboxFolderStatistics $mbx.identity -FolderScope ‘DeletedItems’ | select @{n=”Username”;e={$mbx.displayName}},FolderPath,ItemsInFolder,@{n=”FolderSize(MB)”;e={$_.folderSize.toMB()}}
}
$data | sort-object “FolderSize(MB)” –Descending | export-csv DeletedItemsFolders.csv{/code}