Search-Mailbox SearchQuery - trouble with AND and OR

依然范特西╮ 提交于 2020-02-02 13:35:31

问题


I'm having a fair bit of trouble trying to search for some messages using Search-Mailbox.

Search-Mailbox -Identity $User `
-SearchQuery "Attachment:p* AND From:$email AND To:reception@contoso.com AND Received<`"04/02/2018`" AND Subject:(GfC* OR G4C* OR c4g* OR GfC OR G4C OR c4g)" `
 -LogOnly  -TargetMailbox "myusername" -TargetFolder "SearchAndDeleteLog" -LogLevel Full

However I'm getting matches to messages which don't match the SearchQuery criteria, in particular the Subject:(...).

For example, one email the matched the From and To but didn't have an attachment and had a Subject "RE: RE:"

Is there something I am missing in the KQL as it seems to me I might be getting OR behaviour instead of AND.

来源:https://stackoverflow.com/questions/50452276/search-mailbox-searchquery-trouble-with-and-and-or

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!