This is 2010?

You have to write the searchquery in AQS (in 2013+, you have to use KQL – 
similar but not identical).

AQS: https://msdn.microsoft.com/en-us/library/aa965711(v=vs.85).aspx

KQL: https://technet.microsoft.com/en-us/library/dd298173(v=exchg.160).aspx


From: [email protected] [mailto:[email protected]] On 
Behalf Of Todd Lemmiksoo
Sent: Wednesday, January 13, 2016 4:00 PM
To: [email protected]
Subject: Re: [Exchange] Exchange 2010 - Search Mailbox

looks like it does not work with compound conditional statements. I would break 
it down into single queries.

On Wed, Jan 13, 2016 at 2:00 PM, Sean Martin 
<[email protected]<mailto:[email protected]>> wrote:
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<http://domain1.com>" or 
"*@domain2.com<http://domain2.com>" AND To:"*@domain3.com<http://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





--
T. Todd Lemmiksoo

Reply via email to