Update to Wipe Exchange Online Mailbox Script

Update to Wipe Exchange Online Mailbox Script

4.7/5 - (6 votes)

Earlier this evening, a former peer asked me about trying to bulk delete items from the Drafts folder on a customer’s Exchange Server 2010.  While Microsoft Exchange Server 2010 reached end of support in October 2020, it still will work (though we certainly don’t recommend keeping it around, as it’s no longer receiving regular maintenance, support, or security updates).

Anyway, I digress.

I had previously released the Wipe-ExchangeOnlineMailbox script after a failed 3rd-party tool migration, and have updated it a few times since then to use both Search-Mailbox and EWS to perform deletes on objects in mailboxes (though Search-Mailbox is also deprecated and I need to update the tool again to use New-ComplianceSearch).

At any rate, quickly updating the tool to support another parameter was a relatively quick fix, so I did that.  I updated the DeleteItemOptions parameter set to include a new option: DraftsOnly.  Use this to delete things out of the Drafts WellKnownFolderName path.

And, while the script does have ExchangeOnline in the name, since it uses Autodiscover to locate the target mailboxes, it should work fine on-premises as well.

You can pick up the latest version at https://www.powershellgallery.com/packages/Wipe-ExchangeOnlineMailbox/.

Published by Aaron Guilmette

Helping companies conquer inferior technology since 1997. I spend my time developing and implementing technology solutions so people can spend less time with technology. Specialties: Active Directory and Exchange consulting and deployment, Virtualization, Disaster Recovery, Office 365, datacenter migration/consolidation, cheese.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.