I'm trying to figure out how to delete emails from user inboxes, but the old method I used is no longer available. I used to go through Explorer to remove them, but that option is gone. I've tried switching browsers and adjusting permissions, but nothing works. If Explorer isn't an option anymore, what's the new method for purging emails that slip through the content filters? Appreciate any help!
3 Answers
Here’s the PowerShell command I use: `New-ComplianceSearch -Name "Remove Message" -ExchangeLocation All -ContentMatchQuery '(Received:7/31/2021) AND (Subject:"*")'`. Then, you can start it with `Start-ComplianceSearch -Identity "Remove Message"`, and finally, to purge, `New-ComplianceSearchAction -SearchName "Remove Message" -Purge -PurgeType HardDelete` does the trick.
To clean up mailboxes now, you'll want to use Compliance Search along with a purge action. Microsoft has phased out the older methods like Search-Mailbox, so the current approach in Microsoft 365 is to run a Compliance Search and then purge the results either from the Purview portal or via PowerShell. The Microsoft docs are quite helpful too: check out their guide on eDiscovery and email deletion.
I’m in the Purview portal right now and I don’t see the compliance search option. Do I need to enable something first?
Which platform are you using to manage this?
I’m using the Microsoft 365 admin panel, specifically Outlook.

Just a heads up! When using the new Purview page, you need to start the compliance search manually from PowerShell with the command `Start-ComplianceSearch -SearchName "(your search name here)"`. Otherwise, it could show that the search isn’t ready even if you've run it from Purview.