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
Solved

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

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

This script can help you clean up your user profile database by comparing profiles to Active Directory users in a particular OU, and removing the profiles that don't match.
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
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…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

839 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