1

I have to adapt a script that do "OnPromises" searches a hybrid context. I used the New-MailboxSearch cmdlet to implement this script. The script searches all the indicated mailboxes and copies the results into another mailbox account. Searches can be edited.

The options I have contemplated are:

  • New-ComplianceSearch cmdlet. I don't know how to set an email folder to copy the results.

  • Search-Mailbox cmdlet. It would not be possible to edit the searches later.

Besides, is it possible to do this search in one step? That is, use a single cmdlet without having to do the search first on the mailboxes online and then on the mailboxes onpremises

gsustalo
  • 11
  • 3

1 Answers1

0

You can use powershell pipeline to search all mailboxes:

Get-Mailbox -ResultSize unlimited |Search-Mailbox -SearchQuery 'yourquery'

it isn't new solution, but still works fine in 2010-2016 exchange. You can use get-mailbox -filter key to find certain mailboxes in the fast way.

About New-ComplianceSearch - check this link: https://4sysops.com/archives/search-and-delete-exchange-email-using-powershell/