Search mailbox - Specific date range and specific email address

Hello,

I am trying to search all mailboxes in a specific date range for all mails to and from a specific emailaddress.

I have tried the several variations of the search-mailbox command, but here is the latest.

Get-Mailbox | Search-Mailbox -TargetMailbox Administrator -TargetFolder Discovery -LogLevel Full -IncludeUnsearchableItems -SearchQuery 'Sent:{01/01/2014..01/02/2014} AND To:mail@domain.com'

"The KQL Parser threw an exception".

Could someone please tell me the correct way to use the Search-Mailbox cmdlet to accomplish what I'm trying to do?


  • Edited by SveinS 19 hours 14 minutes ago
September 8th, 2015 8:10am

What is the exception you are getting?

You are piping "Get-Mailbox" into the search, how many mailboxes are returned by the Get-Mailbox command in your environment? It could be a pretty big search.

Do you have rights to the default Discovery Mailbox? Try changing your -TargetMailbox to it instead. The result set is limited to 50GB if memory serves also when using a Disc. MB. I generally like to include legal when ever I do this also.

Hugh

Free Windows Admin Tool Kit Click here and download it now
September 8th, 2015 12:46pm

Great questions from Hugh, please reply and we can provide further detail/guidance

Also what is the patch level of your s

September 8th, 2015 2:45pm

Loose the curly brackets. This will work:

Search-Mailbox -EstimateResultOnly -SearchQuery 'Sent:01/01/2014..01/02/2014 AND To:mail@domain.com'

  • Marked as answer by SveinS 27 minutes ago
Free Windows Admin Tool Kit Click here and download it now
September 8th, 2015 3:32pm

Tutorial for searching mailboxes with specific date: http://thoughtsofanidlemind.com/2014/10/17/using-search-mailbox-to-look-for-items-with-a-specific-date/

For exporting such mailboxes with specific date and email addresses:  http://exchange-recovery.blogspot.com/2015/03/export-mailbox-to-pst-date-range.html

Let me know if it helped you!

September 9th, 2015 1:19am

This did the trick. Thank you very much.
Free Windows Admin Tool Kit Click here and download it now
September 9th, 2015 2:59am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics