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 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,

2 Replies
best response confirmed by px091 (Contributor)



The New-ComplianceSearch cmdlet creates a new content search.


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 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