Search code examples
powershellexchange-serverexchangewebservices

Exchange 365 wipe mailbox (wipe purges)


After an initial failed migration from Google Apps to Office 365, I used Powershell to delete all items in the mailbox and start another sync.

Search-Mailbox -Identity "identity" -DeleteContent -force
Search-mailbox -identity "identity" -SearchDumpsterOnly -DeleteContent

Unfortunately, this moved all items into the "Purges" folder and I have not found a way to purge the purges. Since the items reside in purges, I'm not able to synchronize properly between Google Apps.

Ideally, I'd like to completely wipe the mailbox without deleting the user and start over or at least find a way to clear out the purges folder. Microsoft's best response so far was to wait 30 days until the purges get cleared out....

I did try to set retention to 0 about a day ago with no effect so far:

Set-Mailbox -Identity "mailbox" -RetainDeletedItemsFor 0

Solution

  • For anyone interested, figured out how to remove the purges:

    Set retention period to 0:

    Set-Mailbox -Identity "identity" -RetainDeletedItemsFor 0
    

    Turn off item recovery:

    Set-Mailbox -Identity "identity" -SingleItemRecoveryEnabled $false
    

    Wait > 60 minutes

    Run:

    Start-ManagedFolderAssistant
    

    This will force retention policy to run and wipe out all emails in purges