Disclaimer
This is my personal blog. The opinions and views I express are my own. The information I provide is on an as-is basis. I make no representations as to accuracy, completeness, currentness, suitability, or validity of any information on this blog and will not be liable for any errors, omissions, or delays in this information or any losses, injuries or damages arising from its use.

Search all Exchange 2010 Mailboxes for a specific filename (Powershell)

**** THIS SCRIPT IS PROVIDED WITHOUT WARRANTY, USE AT YOUR OWN RISK ****

Tested on Windows Server 2k8 R2 and Exchange 2010

NOTE: The user you run the script with must have the “Discovery Management” RBAC Role.

This script will search all mailboxes for email with attachments named “document1” and “document2” regardless of the file extension. The script will then copy the email message to the “admin.mailbox” mailbox in a folder called “Search_07102014”. Once the script is complete open “admin.mailbox” in Outlook and you’ll see the “Search_07102014” folder under the Inbox containing all the results.

 

This modification will search for all “.doc” and “.pdf” files and copy them to the same mailbox and folder.

 

To search for keywords use this modification.

 

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.