Hi,
Welcome to the Microsoft forum.
Based on your description, Adding the “-Archive” attribute in the Get-MailboxStatistics section can accomplish your purpose.Like this:
Get-Mailbox -ResultSize Unlimited | Get-MailboxFolderStatistics -IncludeAnalysis -FolderScope All -Archive | Where-Object {(($
.TopSubjectSize -Match "MB") -and ($
.TopSubjectSize -GE 150.0)) -or ($_.TopSubjectSize -Match "GB")} | Select-Object Identity, TopSubject, TopSubjectSize | Export-CSV -path "C:\largeitem.csv" -notype
.
And about the two questions:
(1) The above command can find emails larger than 150MB.
(2) The above command can find the largest email , Open an empty Excel spreadsheet and click File> Open, select the log. After opening, select the Delimited filter type. Next, select “,” and click on Finish. Then use Excel's sort function to sort by size so that you can find the largest email.
Please feel free to contact me for any updates.