Forum Discussion
px091
Jan 30, 2021Iron Contributor
create a new ediscovery search using PowerShell
How to create a new search using PowerShell script within the existing case under eDiscovery Core?
We have hundreds of user exchange email addresses need to add to a new search. I can open the eDiscovery Core case from UI https://compliance.microsoft.com then eDiscovery->Core to open a existing case. After that I need to create a new search and add hundreds of exchange email addresses as selected locations to this new search. It is very time consuming. How can I use PowerShell script to create a new search and then add email addresses to the search? There any guideline or reference to accomplish this task?
Thanks in advance,
Peter
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.
- px091Iron Contributor
Finally I made it work. The following is the cmdlets
New-ComplianceSearch -Name "SearchName" -Case "CaseName" -ExchangeLocation John.doe@somewhere.com
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.