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