Maybe the query parameters need to be logically grouped with parenthesis (line 
breaks added for clarity):
 
Search-Mailbox -identity "mailbox" -searchquery 
'("word1" or "word2" or "phrase 1" or "phrase 2") AND 
(From:"*@domain1.com" or "*@domain2.com") AND 
To:"*@domain3.com"'
 -targetmailbox "targetmailbox" -targetfolder "folder" -loglevel full
 
 


Bud Durland
Director of Information Technology
1 Plant St. Plattsburgh, NY 12901
Office: 518.561.1812  Direct: 518.324.4850  Cell: 518.726.0967 
Weatherchem.com | Moldriteplastics.com | Stulltech.com
 
From: [email protected] [mailto:[email protected]] On 
Behalf Of Sean Martin
Sent: Wednesday, January 13, 2016 3:00 PM
To: [email protected]
Subject: [Exchange] Exchange 2010 - Search Mailbox
 
Good morning/afternoon, 
 
I've been tasked with a broad discovery effort so I'm attempting to put 
together an appropriate search query using the Search-mailbox command. The 
requirements are:
 
1) Message includes any of a number of words or phrases
2) Message was delivered by any of a number of domains
3) Message was sent to a specific domain
 
Here's the syntax I came up with, which executes, but doesn't appear to return 
content matching the search criteria. FYI: I'm testing with a single mailbox, 
but the command will ultimately be run against all mailboxes.
 
Search-Mailbox -identity "mailbox" -searchquery '"word1" or "word2" or "phrase 
1" or "
phrase 2" AND From:"*@domain1.com" or "*@domain2.com" AND To:"*@domain3.com"' 
-targetmailbox "targetmailbox" -targetfolder "folder" -loglevel full
 
It appears to pull e-mails matching the content query, but not specific to the 
sender(s) or recipient specified.
 
Is what I'm trying to accomplish possible? Any help would be appreciated. 
 
- Sean


NOTE -- This message contains legally privileged and confidential information 
and is intended only for the individual named.
If you are not the named addressee you should not disseminate, distribute or 
copy this e-mail.
Please notify the sender immediately by e-mail if you have received this e-mail 
by mistake and delete
this e-mail from your system. Thank you.

Reply via email to