Who knew you’d need an update to a tool meant to delete things?
After working with a partner today and an out-of-control email application spamming user mailboxes, we decided an update was necessary. Outlook became unusable with several hundred thousand messages in Deleted Items. What to do, what to do, WHAT TO DO?
Fortunately, where there’s an EWS, there’s a way.
If you’re already familiar with the tool, you’ll know that I updated it a while ago to help you purge content in archives. Today, I updated it to address items in two core folders: Deleted Items and Recoverable Items.
Imagine, for a moment, you have a gazillion messages in Deleted Items. I don’t here, but just imagine. Astute viewers will also notice that I have items in Recoverable Items (surfaced in the new Outlook Web App view).
If I want to delete these items only, I can head off to my new-and-improved script, using the newfangled DeletedItemOptions parameter:
.\WipeExchangeOnlineMailbox.ps1 -Identity email@example.com -Credential $cred -DeleteItemOptions DeletedItemsOnly
And … [drum roll]
ALL GONE. I’ve sent them to the bit bucket in the sky with the HardDelete delete mode of the Empty() method:
Valid options for DeleteItemOptions are:
- DeletedItemsOnly : Only rids yourself of Deleted Items
- RecoverableItemsOnly : Kicks Recoverable Items to the curb (except Audits–that folder is protected for everything unless your name is SYSTEM)
- Normal : The original. When you absolutely, positively, must delete every damn thing–accept no substitutes.
For my next trick, we’re going to go see what we can do with Recoverable Items:
Yep, there’s something in there I had previously moved from Deleted Items. Fortunately, we can get rid of these, too, with my updated script:
The result is both exciting and anticlimactic: EVEN MOAR GONE.
If you find yourself in need of deleting content, look no further than this lovely TechNet script. I’m always deleting for you.