Solved

Exchange 2010 search-mailbox query syntax

Posted on 2013-11-27
3
20,563 Views
Last Modified: 2013-11-28
I am trying to use the following EMC command:

Search-Mailbox -Identity "<user>" -SearchQuery 'Subject:"Example subject"' -DeleteContent

And it works, the problem is, almost too well. So it will go into a mailbox and delete any email with the subject:

Example Subject

but it will also delete any with the subject

RE: Example Subject
FW: Example subject

etc..

my question is how do I do this, and have the exact string, so it won't delete variations of it ?

Thanks,
0
Comment
Question by:sattermc
3 Comments
 
LVL 35

Expert Comment

by:Mahesh
ID: 39681483
0
 

Author Comment

by:sattermc
ID: 39681546
That is basically running the same command that I am. Mine does work. I just want to delete the original email only. not any "RE:" or "FW:"

my problem is that it deletes, any responses, or forwards as well.
0
 
LVL 40

Accepted Solution

by:
Subsun earned 500 total points
ID: 39682029
Exchange 2010 Search Mailbox query doesn’t support the “FW” & “RE” in Subject Query. You need to add multiple conditions to narrow down the search and delete the emails.. For instance add subject and send time and from address..
Search-Mailbox -Identity "USER" -SearchQuery 'subject:"Example Subject" AND Received:< 01/01/2010 AND from:subsun@ee.com' -DeleteContent -force

Open in new window

For syntax refer..
http://help.outlook.com/en-US/140/ms.exch.ecp.newmailboxsearch_searchquery.aspx
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Exchange server is not supported in any cloud-hosted platform (other than Azure with Azure Premium Storage).
Find out how to use Active Directory data for email signature management in Microsoft Exchange and Office 365.
The basic steps you have just learned will be implemented in this video. The basic steps are shown to configure an Exchange DAG in a live working Exchange Server Environment and manage the same (Exchange Server 2010 Software is used in a Windows Ser…
how to add IIS SMTP to handle application/Scanner relays into office 365.

708 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now