Forum Discussion
create a new ediscovery search using PowerShell
- Jan 30, 2021
The New-ComplianceSearch cmdlet creates a new content search. https://docs.microsoft.com/en-us/powershell/module/exchange/new-compliancesearch?view=exchange-ps
One way of approaching the issue is to create the search using the GUI to make sure that you have all the other settings right and then running the Set-ComplianceSearch cmdlet https://docs.microsoft.com/en-us/powershell/module/exchange/set-compliancesearch?view=exchange-ps and pass the list of Exchange mailboxes in the AddExchangeLocation parameter. The best idea is to use distribution lists to specify the mailboxes you want to add.
All covered in the Office 365 for IT Pros eBook if you need a guide.
Finally I made it work. The following is the cmdlets
New-ComplianceSearch -Name "SearchName" -Case "CaseName" -ExchangeLocation mailto:$John.doe@somewhere.coms