Sunday, October 30, 2022

Admin search with date string yields unexpected results or no result [MS]

Symptoms

When running an admin search request that includes a possible date within the query string, you get unexpected results if the date string is in a UK format (day/month/year). This doesn't include the date property of the search query.

Examples:

  Search-Mailbox -Identity User1 -TargetFolder SearchResults -TargetMailbox SearchUser -SearchQuery 'attachment:"SEG 12 12 2019.txt"'

  Search-Mailbox -Identity User1 -TargetFolder SearchResults -TargetMailbox SearchUser -SearchQuery 'subject:"Born 12 12 2019 USA"'

Cause

This is a known issue in the word breaker.

Workarounds

Method 1:

Don't use dates in the SearchQuery string.

Note You can still use dates for searchable date properties. 

Method 2:

Break up the date with a wildcard.

Here are two examples showing how to use the wildcard:

  Search-Mailbox -Identity User1 -TargetFolder SearchResults -TargetMailbox SearchUser -SearchQuery 'subject:"Born 12 12 * 2019 USA"'

  Search-Mailbox -Identity User1 -TargetFolder SearchResults -TargetMailbox SearchUser -SearchQuery 'attachment:"SEG 12 12 * 2019 txt"'

No comments:

Post a Comment

Search This Blog

August 8, 2017, update for Word 2016 (KB3213656) - Microsoft Support [MS]

August 8, 2017, update for Word 2016 (KB3213656) Word 2016 More... Less...