Search-Mailbox -SearchQuery not working as expected

I want to find messages with the exact subject "eFax Report", not subjects containing the word "eFax Report".  I've tried all of the following search querys and get the same results which include subjects such as "FW: eFax Report", "Aug eFax Report", ect. 

Any ideas?

Search-Mailbox -SearchQuery {Subject="eFax Report"}
Search-Mailbox -SearchQuery {Subject:"eFax Report"}
Search-Mailbox -SearchQuery 'Subject="eFax Report"'
Search-Mailbox -SearchQuery 'Subject:"eFax Report"'

March 2nd, 2015 9:53pm

The third query should be the one according to the KQL reference here: https://msdn.microsoft.com/library/ee558911(v=office.15).aspx

Search-Mailbox -SearchQuery Subject="eFax Report"

Try the above. Remember that if you include white space between the Property name, operator or value it alters the query and causes it to return results that contain the value you're searching for.
Free Windows Admin Tool Kit Click here and download it now
March 2nd, 2015 11:08pm

You can try

Get-Mailbox Server Server Name | Search-Mailbox -SearchQuery 'Subject:"Your bank statement"' -TargetMailbox "DiscoveryMailbox" -TargetFolder "Search Items" -LogLevel Full 

And you can also use New-MailboxExportRequest

https://technet.microsoft.com/en-us/library/ff607299(v=exchg.150).aspx

March 3rd, 2015 12:04am

Have you tried the query's submitted.  I've tried and it does not return the exact subject but the word(s) contained in subjects searched.  I'm sure anyone can verify.  Can anyone confirm?

Free Windows Admin Tool Kit Click here and download it now
March 3rd, 2015 2:48pm

You are correct.  I've tried all manner of queries and all the results returned contain the subject searched rather than equal it.
March 3rd, 2015 5:04pm

Hi,

Refer to this document and take a look at the detailed explanation of Example 2&3, this query will return the messages that contain the phrase in the subject.

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

Best Regards.

Free Windows Admin Tool Kit Click here and download it now
March 5th, 2015 4:09am

Hi,

Refer to this document and take a look at the detailed explanation of Example 2&3, this query will return the messages that contain the phrase in the subject.

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

Best Re

March 5th, 2015 7:12am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics