Find large items in Exchange mailboxes
Problem:
You want to find out the messages and mailbox items which are greater in size than the target size limit.
Solution:
You might need this information when you plan to migrate your Exchange environment and the message size limits on the target Exchange Server differ from those in your current environment. Although you can change these restrictions in on-premises Exchange Server configurations, you may be unable to do so due to organizational policies. Furthermore, Microsoft has imposed a fixed message size limit of 150 MB for Exchange Online (Office 365). In such a case, you may need to locate and delete / archive every large-sized message in the source mailboxes before you migrate.
Steps to find the largest item in MS Exchange server 2010 and later
- Open the Exchange Management Shell.
- Run the following command:
Get-Mailbox -ResultSize Unlimited | Get-MailboxFolderStatistics -IncludeAnalysis -FolderScope All | Where-Object {(($_.TopSubjectSize -Match "MB") -and ($_.TopSubjectSize -GE 75.0)) -or ($_.TopSubjectSize -Match "GB")} | Select-Object Identity, TopSubject, TopSubjectSize | Export-CSV -path "C:\largeitem.csv" -notype
The parameter Get-Mailbox -Identity Administrator limits the search only to the administrator's mailbox.
The preceding command lists the emails having the size greater than 75MB and creates a largeitem.csv file in the location you mention (C:\ in the above example). This file contains a list of mailbox folders with subjects and sizes of the largest items (greater than 75 MB).
Note:Change the target path in the cmdlet on those machines where the path C:\ is not writable