Hey folks, I'm in a bit of a crunch. I've had several outages and it's nearly 3AM after starting my workday at 4AM. Now, I'm dealing with a flood of phishing attempts, including fake calendar events about 'Microsoft Subscription Expired!'. To make matters worse, Microsoft recently changed how we can purge data, which is really throwing a wrench into things for my E3 organization. We don't have E5 or any other high-tier licenses, and I'm not looking for any costly alternatives. Can someone please share a working content search and purge script that works post-2025 update? Thanks!
2 Answers
I totally get your struggle! Here’s a script that I found on the MS Learn site. You can check it out here: https://learn.microsoft.com/en-us/graph/api/security-ediscoverysearch-purgedata?view=graph-rest-1.0&tabs=powershell. Basically, you’ll want to import the Microsoft.Graph.Security module and then set your parameters like this:
```powershell
Import-Module Microsoft.Graph.Security
$params = @{
purgeType = "recoverable"
purgeAreas = "teamsMessages"
}
Clear-MgSecurityCaseEdiscoveryCaseSearchData -EdiscoveryCaseId $ediscoveryCaseId -EdiscoverySearchId $ediscoverySearchId -BodyParameter $params
```
This script should help you get back to normal without the heavy licensing! Let me know how it goes!
I don’t have E5 either, just E3. I wish I had a PowerShell script to share, but I mainly use the GUI for Purview since I haven’t had time to automate anything lately. I’d also be very interested to see what others are using!
Just a heads up, don't you need a premium eDiscovery case for that?