Locate messages larger than 150 MB

This Powershell script will help you to locate messages that are larger than 150 MB from user's on-premise mailbox and export to CSV. You can the use this report to inform users to archive or delete the items found. This is important action point in Office 365 mailbox migration

5 Star
1,259 times
Add to favorites
Office 365
E-mail Twitter del.icio.us Digg Facebook
Sign in to ask a question

  • Does the title needs to be corrected?
    2 Posts | Last post August 28, 2016
    • Script is scanning for items >35 MB; not sure why title says 150 MB?
    • Corrected the script.... Check now.
  • Exchange version compatability
    1 Posts | Last post November 25, 2014
    • Sandeep - Do you know if this works for Exchange 2007 SP3?  I dont see the option "-IncludeAnalysis" when i run Get-MailboxFolderStatistics cmdlet from Exchange 2007 server PowerShell.
  • Sounds promising, but not working for me
    2 Posts | Last post August 10, 2014
    • We are a MSP and would love to find all files a client has over 25 MB *before* we try to migrate them to O365 or our hosted environment. Everyone can get what the largest email is in the mailbox or email folder, but this is the first post promising to give me all items greater than x mb.
      I tried breaking down the script to test 1 user before bringing in the CSV file.
      I tried it on our hosted Exch 2013 since the 2 clients we are next going to migrate are 2003 and 2007 without PS 3.0. 
      Get-MailboxFolderStatistics -identity "Jerry" -IncludeAnalysis |`Where-Object {($_.TopSubjectSize -Match "MB") -and ([int](($_.TopSubjectSize).SubString(0,5)) -GE 35.00)}
      But I get an error that:
      "Where-Object : Method invocation failed because [Microsoft.Exchange.Data.ByteQuantifiedSize] doesn't contain a method named 'SubString'"
      Does that method exist only in certain versions that I am not running and you are?
    • Sorry for the delayed response. Yes. You will need to have PowerShell version 3 installed on the system for the script to run correctly.