Solved

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

Posted on 2014-09-11
2
563 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
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

Want to promote your upcoming event?

Are you going to an event? Are you going to be exhibiting at a tradeshow? Talking at a conference? Using a promotional banner in your email signature ensures that your organization’s most important contacts stay in the know and can potentially spread the word about the event.

Join & Write a Comment

This article will help you understand what HashTables are and how to use them in PowerShell.
Following basic email etiquette rules will help you write a professional email and achieve a good, lasting impression with your contacts.
In this video we show how to create a mailbox database 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 Servers >> Data…
To show how to generate a certificate request 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 Servers >> Certificates…

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

14 Experts available now in Live!

Get 1:1 Help Now