I am facing a problem when a migration process from GSuite led to an unconsistent user's mailbox - migration process stopped several times and finally hit mailbox size limit (100Gb) which is much more than expected (~65Gb).
So the mailbox should be cleaned completely and I would like to perform another kind of migration (not API-based, at least - via IMAP or even PST). The problem is I can't find any solution to empty the mailbox.
What I have tried so far:
- Emptying the mailbox with outlook online - folders are empty, but mailbox usage is about 70Gb (this is probably my mistake - see below)
- Empty the mailbox using search-mailbox -DelectContent cmdlet - extremely slow, no effect, mailbox usage is about 70Gb
- Applying set-mailbox -RetainDeletedItemsFor 0 cmdlet - still no effect.
Is there a way like it was in on-prem exchange - disconnecting a mailbox from user and creating a new one from scratch?
In Office 365 admin center > USESRS > Active Users > find the user, delete it. It will go to the Deleted Users.
Create a brand new mailbox with exactly the same information for the user
In addition, i found a similar thread for your reference: Wipe Content from an Exchange Online Mailbox
Here's one method of doing it:
Remove the Exchange Online license from the user in question.
Connect to Exchange Online with Powershell.
Run the following command:
Set-User [email protected] -PermanentlyClearPreviousMailboxInfo
Re-assign the Exchange Online license.
This will create a new, empty mailbox for the user in question.