Solved

Search-Mailbox Results, how to filter out "RE:"'s and "FW:"'s

Posted on 2014-09-11
2
648 Views
Last Modified: 2014-09-12
I am running the fallowing command:

Get-Mailbox -Server Dalmbx01 | Search-Mailbox -SearchQuery 'Subject: "James Stole my LUNCH!"' -targetmailbox "ABC" -TargetFolder "test03"  -loglevel full

however it returns results that include "FW: James Stole my LUNCH!" and "RE: James Stole my LUNCH!"

We JUST want to find and destroy the original: Messages "James Stole my LUNCH!" and not the FW: or RE:  or anything else that might be like "James Stole my LUNCH - LOLz check it"

Simply adding a NOT '"RE:"' seems to kill off all results.
0
Comment
Question by:BBDallas
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 40

Accepted Solution

by:
Subsun earned 500 total points
ID: 40318547
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
 

Author Closing Comment

by:BBDallas
ID: 40319506
Thank you.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

A project that enables an administrator to perform actions within a user session context not just at the time of login but any time later on day(s) or week(s) later.
A recent project that involved parsing Tableau Desktop and Server log files to extract reusable user queries for use in other systems. I chose to use PowerShell to gather the data, and SharePoint to present it...
In this video we show how to create a Shared Mailbox 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 Recipients >> Sha…
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…
Suggested Courses

636 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