Solved

Exchange 2010 search-mailbox query syntax

Posted on 2013-11-27
3
21,511 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 36

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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Outlook keeps asking for credentials, and then does not except. 10 64
Never expired checked 2 19
Problem to setup GUI 11 32
Really super easy powershell question 3 23
Find out what you should include to make the best professional email signature for your organization.
This article lists the top 5 free OST to PST Converter Tools. These tools save a lot of time for users when they want to convert OST to PST after their exchange server is no longer available or some other critical issue with exchange server or impor…
In this video we show how to create a Resource Mailbox in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: Navigate to the Recipients >> Resources tab.: "Recipients" is our default selection …
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

776 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