The following table outlines the properties that can be used to define an AQS query using a word phrase restriction:
Property |
Examples |
Description |
---|---|---|
|
|
This searches for items that have an attachment with a specific name, such as |
|
|
This searches for items where |
|
|
This searches for items sent from |
|
|
This searches for items sent to |
|
|
This searches for items where |
|
|
This searches for items with the word |
|
This searches for items with the words | |
|
|
This searches for items where the word |
|
|
This searches for items with |
|
|
This searches for items that have the |
Not Defined |
|
This searches for items that contain both |
When performing a word phrase search, the property names and search terms are case insensitive. If you want an exact match, enclose the search query in double quotes, otherwise the search will default to a prefix match. For example, searching for the term report would match the word reporting unless enclosed in double quotes, indicating an exact search.
If you want to delete all the messages in the administrator mailbox where the sender's e-mail address is [email protected]
, use the following commands:
Search-Mailbox -Identity administrator ' -SearchQuery "from:[email protected]" ' -DeleteContent ' -Force
If you want to create a discovery search based on messages that contain the phrase Employee Salary
in every mailbox, use the following code:
New-MailboxSearch -Name MySearch ' -TargetMailbox "Discovery Search Mailbox" ' -SearchQuery 'Body:"Employee Salary"' ' -MessageTypes Email ' -IncludeUnsearchableItems ' -LogLevel Full