Using a date range search
The following table outlines the properties that can be used to define a KQL query using a date range restriction:

You can use relative dates when performing a date range restricted search. For example, today
, tomorrow
, or yesterday
can be used with the Received
or Sent
keywords.
You can use a specific day of the week: (Sunday
, Monday
, Tuesday
, Wednesday
, Thursday
, Friday
, or Saturday
) with the Received
or Sent
keywords.
You can also use a specific month: (January
, February
, March
, April
, May
, June
, July
, August
, September
, October
, November
, or December
) with the Received
or Sent
keywords.
Examples
If you want to delete all messages in the administrator mailbox that were received today, use the following command:
Search-Mailbox administrator '-SearchQuery "Received:today" '-DeleteContent -Force
If you want to delete all messages in the administrator mailbox that have been received between March and July, use the following command:
Search-Mailbox administrator '-SearchQuery...