Exchange - Search all mailboxes for message with stringq

Posted on 2015-02-18
Medium Priority
Last Modified: 2015-03-09
In an Exchange 2007 environment, what is the best way to search all mailboxes for messages with a specific string?

I found this article which talks about removing the messages: http://blogs.technet.com/b/exchange/archive/2010/10/27/removing-specific-messages-from-your-exchange-server.aspx

However, I would like to first just discover what messages are there to see who they went to before doing a mass removal.
Question by:Schuyler Dorsey
1 Comment
LVL 13

Accepted Solution

Guy Lidbetter earned 2000 total points
ID: 40618779
Hi Schuyler,

You use the same commands get-mailbox | export-mailbox, you just leave out the delete request... i.e.

Get-Mailbox -ResultSize Unlimited | Export-Mailbox -ContentKeywords "Specific String" -TargetMailbox YourMailbox -TargetFolder 'A Folder in your mailbox'

Open in new window

This will place a copy of any mail with the required string into a specified folder in your mailbox. It will create the folder if it doesn't exist.

Just add -deleteContent to the end to remove it.



Featured Post

Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Here is a method which can be used to help resolve a "Content Index Failed" error on a Microsoft Exchange Server.
Let us take a look at the scenario, you have a database that is corrupt and you run the ESEUTIL command only to find you are unable to repair it. How do you now get the data back?
The video tutorial explains the basics of the Exchange server Database Availability groups. The components of this video include: 1. Automatic Failover 2. Failover Clustering 3. Active Manager
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…

607 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question