Powershell Script to Generate eDiscovery Case

Clayton Amelia
Occasional Contributor

Hello Everyone,


Currently working on a series of scripts that I will be using to administrate Office365 regularly for my clients, including one to generate the eDiscovery search and export. In my script I found that the param -OneDriveLocation for New-ComplianceSearch comes up as an invalid parameter.

new-compliancesearch-gethelp-fail.pngGet-Help failnew-compliancesearch-fail.pngCmdlet Fail

The whole premise behind this is to automate the user decommissioning process as much as possible, even if the last step is to log into the compliance center and download the clickonce application to export the zipped up export, we can easily save 30~60 minutes per user decommissioning we have to run, with an average of 3 a day it allows my techs on our service desk to work on other tickets during that time frame.

2 Replies

Use the -SharePointLocation  parameter.


New-ComplianceSearch testODFB -SharePointLocation
This definitely worked, not sure why I didn't try this to begin with before jumping on here! Thank you for the quick reply Vasil!

When checking the properties of the SearchCase object both the SharePointLocation and OneDriveLocation properties have the same contents when adding the OneDrive.

Now, time to do some reading into downloading contents from Azure blob storage using Powershell to automate the last piece. Will post up on here again if I have any questions, unless there is a different discussion I should post under.
Related Conversations
Tabs and Dark Mode
cjc2112 in Discussions on
46 Replies
Extentions Synchronization
Deleted in Discussions on
3 Replies
Stable version of Edge insider browser
HotCakeX in Discussions on
35 Replies
How to Prevent Teams from Auto-Launch
chenrylee in Microsoft Teams on
30 Replies
flashing a white screen while open new tab
Deleted in Discussions on
14 Replies
Security Community Webinars
Valon_Kolica in Security, Privacy & Compliance on
13 Replies