Solved

Need Exchange 2010 tool to do selective purge

Posted on 2013-06-26
4
353 Views
Last Modified: 2013-06-26
Hello,

I have been tasked to find some kind of script or program that can do the following.

1. Reach into all existing Exchange accounts
2. Read each email between a certain date range
3. Apply a conditions based filter and delete each email that finds a match.

For example, if an email has a certain email address in the to, from, subject, or body of an email, delete it.  If not, check the next condition, etc...  I have a list of such conditions that need to be searched for, so the ability to nest AND/OR statements it a must.

Can anyone recommend any software or script that can do this?

TIA
0
Comment
Question by:TakedaT
[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
  • 2
4 Comments
 
LVL 14

Expert Comment

by:Raj-GT
ID: 39277970
You can use the search-mailbox powershell cmdlet for this. See http://technet.microsoft.com/en-us/library/dd298173%28v=exchg.141%29.aspx

You can search across all mailboxes in your Exchange Organization and delete/move mails matching your criteria to a target mailbox.
0
 
LVL 10

Author Comment

by:TakedaT
ID: 39279423
Thanks, Raj-GT.  This looks really powerful, but also really dangerous if a typo is made.  Could you also point me to some help on setting up a complex query?  I looked around all I can find is rather simple queries.  Or if you can lend a hand yourself.

For example, I have a list of domain names that I need to find in all parts of an email, To:, From: Subject: Body. and delete any found.

Then I have a list of keywords to find matches on.  For example, if an email has the word 'firstword' but also has 'secondword' in it.  Then 'firstword' and 'thirdword'.  and delete these if found.

So a brief summary would be:
Match all emails where To: OR From: OR Subject: OR Body: contains any of the following
  domain1.com
  domain2.net
  domain3.org
-end of first condition
Match any email with 'firstword' AND at least one of the following:
  secondword
  thirdword
  fourthword
  etc..
-end of second condition

I would like to do this in one pass if possible.  the way it looks is I may need to do 25 or so passes as my list of words is at about 20.
0
 
LVL 14

Accepted Solution

by:
Raj-GT earned 500 total points
ID: 39279507
The searchstring could simply be "domain1.com OR domain2.net OR domain3.org AND secondword OR thirdword OR fourthword". You can test your search query using the multi mailbox search feature in exchange 2010. This will not allow you to delete the messages but just copy them to a target mailbox. See link below for instructions...

http://demazter.wordpress.com/2010/04/29/multi-mailbox-search-with-exchange-2010/
0
 
LVL 10

Author Closing Comment

by:TakedaT
ID: 39280054
OK, you got me in the right direction.  It looks like it takes nested statements inside parenthesis like a normal math equation.  So doing "domain1.com OR domain2.net OR (firstword AND secondword) OR (firstword AND thirdword) OR etc..." does what I need.

Thanks for the help.
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

How to resolve IMCEAEX NDRs in Exchange or Exchange Online related to invalid X500 addresses.
A list of top three free exchange EDB viewers that helps the user to extract a mailbox from an unmounted .edb file and get a clear preview of all emails & other items with just a single click on mailboxes.
This video demonstrates how to sync Microsoft Exchange Public Folders with smartphones using CodeTwo Exchange Sync and Exchange ActiveSync. To learn more about CodeTwo Exchange Sync and download the free trial, go to: http://www.codetwo.com/excha…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

733 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