I'm dealing with a situation where I need to delete around 2000 email items from 8 different mailboxes. I've looked into eDiscovery, which allows me to pull all the data, but it doesn't let me delete the emails. When I try connecting to Exchange Online, I'm limited to only 10 items per search. What are my options for purging these emails efficiently? Any advice would be appreciated!
5 Answers
I suggest doing a compliance search in the Security and Compliance Center and using the New-ComplianceSearchAction with the -Purge parameter. The 10 item limit you noticed applies to the older Search-Mailbox cmdlet, which is outdated. Compliance searches are much more powerful and can handle larger batches without that restriction.
If the emails are from the same source, consider doing a message trace to get an overview. Then, from the results, you can delete them all at once. This could simplify your task, especially since you’re dealing with multiple dates and senders. Just make sure you verify everything before hitting delete!
That's actually a good point! I'll look into that, thanks!
For your task, the best approach is pairing New-ComplianceSearch with New-ComplianceSearchAction -Purge. Just narrow down your search query to keep results precise, run it, and then you’re good to go with the delete action. Remember, the key here is ensuring your query is tight to avoid unintended deletions!
You can utilize the Graph API along with PowerShell, which can be effective for this. It’s usually easier than using eDiscovery alone. Run a command to filter the emails you want to delete, and make sure to practice with a few messages first to avoid accidentally deleting important stuff!
Check out Microsoft's documentation on using PowerShell to delete emails. It outlines how to set up a command that can help you purge multiple items effectively. Just make sure to double-check you're using the correct parameter as sometimes it can lead to errors if it's not recognized. It’s a bit technical, but worth it!
Thanks for the tip! But when I tried using the purge command, I got an error saying the parameter cannot be found. Any ideas?

Thanks for the info! Is there a difference between SoftDelete and HardDelete in this context?