Solved

Exchange 2010 search-mailbox query syntax

Posted on 2013-11-27
3
22,051 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Windows 10 came with  a lot of built in applications, Some organisations leave them there, some will control them using GPO's. This Article is useful for those who do not want to have any applications in their image (example:me).
In this video we show how to create an Accepted Domain in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Mail Flow >> Ac…
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

828 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