Find large items in Exchange 2010 Using PowerShell

Problem:

A client needed to find and remove all of the largest items withing their Exchange databases using PowerShell.

Solution:

Running the below command gives you a .csv file with all items over 50MB in size.

Get-Mailbox -ResultSize Unlimited | Get-MailboxFolderStatistics -IncludeAnalysis -FolderScope All | Where-Object {(($_.TopSubjectSize -Match "MB") -and ($_.TopSubjectSize -GE 50.0)) -or ($_.TopSubjectSize -Match "GB")} | Select-Object Identity, TopSubject, TopSubjectSize, DisplayName | Export-CSV -path "C:\temp\report.csv" -notype

Leave a Reply

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