I am trying to search emails that contains some string in their body. I have two email which contains the work booze.
The command I am using to search is
Get-Mailbox | Search-Mailbox -SearchQuery "Body:'booze'" -WarningAction:SilentlyContinue -EstimateResultOnly -SearchDumpster:$false
but this command is returning 0. What is wrong with this command?
I run a similar command for subject which works
Get-Mailbox | Search-Mailbox -SearchQuery "Subject:'test'" -WarningAction:SilentlyContinue -EstimateResultOnly -SearchDumpster:$false
You don't need to add the
Body:
section. Try this (untested):https://technet.microsoft.com/en-us/library/dd298173(v=exchg.160).aspx