Requirement
Reset an Exchange mailbox to default deleting all existing content without deleting the active user account and other Microosft cloud content associated with the user account
Issue
Resolution
Start by removing ONLY the Exchange license from the Active User in the Microsoft 365 admin portal.
PWSH7
After removing the Exchange license, wait a few minutes and enter the following commands.
> connect Exchange-Online -UserPrincipalName administrator@contoso.com
> get-user "user.to.reset@contoso.com"
Name PreviousRecipientTypeDetails RecipientType RecipientTypeDetails ---- ---------------------------- ------------- -------------------- 03e95a20-3652-4895-af25-6deed0856081 UserMailbox MailUser MailUser
Note: PreviousRecipientTypeDetail changes from None when the license has been removed.
> get-mailbox "user.to.reset@contoso.com"
Get-Mailbox: Ex6F9304|Microsoft.Exchange.Configuration.Tasks.ManagementObjectNotFoundException|The operation couldn't be performed because object 'richard.grant@exoip.com' couldn't be found
Note: get-mailbox fails when the mailbox has been soft deleted
WARNING: The following command triggers immediate and permanent deletion of mailbox content!
> set-user "user.to.reset@contoso.com" -PermanentlyClearPreviousMailboxInfo
Confirm Are you sure you want to perform this action? Delete all existing information about user Identity:'user.to.reset@contoso.com'?. This operation will clear existing values from Previous home MDB and Previous Mailbox GUID of the user. After deletion, reconnecting to the previous mailbox that existed in the cloud will not be possible and any content it had will be unrecoverable PERMANENTLY. This operation will also create an async task to purge all the mail data. You can check the status by running 'Get-User <Identity> | fl *Workload*' and check if DesiredMailboxWorkloads is set to null. Do you want to continue? YNOTE: The mailbox cane
NOTE: It may take up to 8 hours for the Exchange server to synchronise and delete the content.
Monitor status of the user until value return null
> get-user "user.to.reset@contoso.com" | fl *WorkLoad*
Mailbox is waiting to be deleted
MailboxWorkloads : Mail, Calendar, Contacts, Substrate DefaultMailboxWorkloadsMask : Mail, Calendar, Contacts, Substrate DesiredMailboxWorkloads : Substrate DesiredMailboxWorkloadsModified : 18/04/2024 11:20:20 DesiredMailboxWorkloadsGracePeriod : None
Mailbox has been deleted
MailboxWorkloads : Mail, Calendar, Contacts, Substrate DefaultMailboxWorkloadsMask : Mail, Calendar, Contacts, Substrate DesiredMailboxWorkloads : DesiredMailboxWorkloadsModified : DesiredMailboxWorkloadsGracePeriod :
Finally. Reassign an Exchange license to the Active User in the Microsoft 365 admin portal.
« Go back
Powered by Help Desk Software HESK, in partnership with SysAid Technologies