How to find the largest item in Archive folder in MS Exchange 2016

Jonathan Priyaraj 120 Reputation points
2024-05-10T13:37:18.1133333+00:00

Hi . We are migrating from on premise exchange to Exchange online. We are on process of finding large mails greater than 150 MB within a user mail box. I am using the below query to do it . Get-Mailbox -ResultSize Unlimited | Get-MailboxFolderStatistics -IncludeAnalysis -FolderScope All | 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 . However i noticed it returns only items within primary mailbox. I need it to search the person's Archive as well. 1) Is there any commands to find larger mail (>150) ? 2) And is the above command right method to find the largest mail ?

Microsoft Exchange Online Management
Microsoft Exchange Online Management
Microsoft Exchange Online: A Microsoft email and calendaring hosted service.Management: The act or process of organizing, handling, directing or controlling something.
4,246 questions
Exchange Server Management
Exchange Server Management
Exchange Server: A family of Microsoft client/server messaging and collaboration software.Management: The act or process of organizing, handling, directing or controlling something.
7,389 questions
0 comments No comments
{count} votes

Accepted answer
  1. Mike Hu-MSFT 855 Reputation points Microsoft Vendor
    2024-05-13T07:16:26.7933333+00:00

    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 .User's image

    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.


0 additional answers

Sort by: Most helpful