Using the word phrase search
The following table outlines the properties that can be used to define an AQS query using a word phrase restriction:
Property |
Examples |
Description |
---|---|---|
|
|
Searches for items that have an attachment with a specific name, such as |
|
|
Searches for items where |
|
|
Searches for items sent from Bob or Bob Smith. |
|
|
Searches for items sent to Bob or Bob Smith. |
|
|
Searches for items where Bob was included in the blind carbon copy line. |
|
|
Searches for items with the word "sales" in the subject line. Searches for items with the words "sales" or "meeting" in the subject line. |
|
|
Searches for items where the word "financial" appears in the message body. |
|
|
Searches for items with Bob Smith in the |
|
|
Searches for items that have the critical retention tag applied. |
(Not Defined) |
Financial Report |
Searches for items that contain both "Financial" and "Report" in all word phrase properties. |
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.
Examples
If you want to delete all the messages in the administrator mailbox where the sender's e-mail address is <sales@contoso.com>
, use the following code:
Search-Mailbox -Identity administrator ` -SearchQuery "from:sales@contoso.com" ` -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