SOLVED
Home

Powershell Script to Generate eDiscovery Case

%3CLINGO-SUB%20id%3D%22lingo-sub-688930%22%20slang%3D%22en-US%22%3EPowershell%20Script%20to%20Generate%20eDiscovery%20Case%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-688930%22%20slang%3D%22en-US%22%3E%3CP%3EHello%20Everyone%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ECurrently%20working%20on%20a%20series%20of%20scripts%20that%20I%20will%20be%20using%20to%20administrate%20Office365%20regularly%20for%20my%20clients%2C%20including%20one%20to%20generate%20the%20eDiscovery%20search%20and%20export.%20In%20my%20script%20I%20found%20that%20the%20param%20-OneDriveLocation%20for%20New-ComplianceSearch%20comes%20up%20as%20an%20invalid%20parameter.%3CBR%20%2F%3E%3CBR%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F117972iF1510CD09ABEE526%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22new-compliancesearch-gethelp-fail.png%22%20title%3D%22new-compliancesearch-gethelp-fail.png%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EGet-Help%20fail%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F117971i830D988CDBCB7F7B%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22new-compliancesearch-fail.png%22%20title%3D%22new-compliancesearch-fail.png%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3ECmdlet%20Fail%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EThe%20whole%20premise%20behind%20this%20is%20to%20automate%20the%20user%20decommissioning%20process%20as%20much%20as%20possible%2C%20even%20if%20the%20last%20step%20is%20to%20log%20into%20the%20compliance%20center%20and%20download%20the%20clickonce%20application%20to%20export%20the%20zipped%20up%20export%2C%20we%20can%20easily%20save%2030~60%20minutes%20per%20user%20decommissioning%20we%20have%20to%20run%2C%20with%20an%20average%20of%203%20a%20day%20it%20allows%20my%20techs%20on%20our%20service%20desk%20to%20work%20on%20other%20tickets%20during%20that%20time%20frame.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-688930%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ECompliance%20Center%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EOffice%20365%20Administration%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EPowerShell%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-689337%22%20slang%3D%22en-US%22%3ERe%3A%20Powershell%20Script%20to%20Generate%20eDiscovery%20Case%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-689337%22%20slang%3D%22en-US%22%3E%3CP%3EUse%20the%26nbsp%3B%3CFONT%20style%3D%22background-color%3A%20%23ffffff%3B%22%3E-SharePointLocation%26nbsp%3B%3C%2FFONT%3E%20parameter.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3ENew-ComplianceSearch%20testODFB%20-SharePointLocation%20https%3A%2F%2Ftenant-my.sharepoint.com%2Fpersonal%2Fuser_domain_com%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-693134%22%20slang%3D%22en-US%22%3ERe%3A%20Powershell%20Script%20to%20Generate%20eDiscovery%20Case%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-693134%22%20slang%3D%22en-US%22%3EThis%20definitely%20worked%2C%20not%20sure%20why%20I%20didn't%20try%20this%20to%20begin%20with%20before%20jumping%20on%20here!%20Thank%20you%20for%20the%20quick%20reply%20Vasil!%3CBR%20%2F%3E%3CBR%20%2F%3EWhen%20checking%20the%20properties%20of%20the%20SearchCase%20object%20both%20the%20SharePointLocation%20and%20OneDriveLocation%20properties%20have%20the%20same%20contents%20when%20adding%20the%20OneDrive.%3CBR%20%2F%3E%3CBR%20%2F%3ENow%2C%20time%20to%20do%20some%20reading%20into%20downloading%20contents%20from%20Azure%20blob%20storage%20using%20Powershell%20to%20automate%20the%20last%20piece.%20Will%20post%20up%20on%20here%20again%20if%20I%20have%20any%20questions%2C%20unless%20there%20is%20a%20different%20discussion%20I%20should%20post%20under.%3C%2FLINGO-BODY%3E
Highlighted
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
Solution

Use the -SharePointLocation  parameter.

 

New-ComplianceSearch testODFB -SharePointLocation https://tenant-my.sharepoint.com/personal/user_domain_com
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