Forum Discussion
Cannot Delete a Mailbox with Retention Policies Enabled
Dear,
In my environment I have a retention policy in the Secure & Compliance center for Exchange Online mail. Now I have an service account that had a mailbox in the past, but not needed anymore and the service account still need to exist in the environment for some reason. If I open the user in de admin portal a message appear: "Exchange: An unknown error has occurred. Refer to correlation ID: xxx-xx-xxx". Now I got the error message with command;
(Get-MsolUser -UserPrincipalName domain@domain.com).errors[0].ErrorDetail.objecterrors.errorrecord.ErrorDescription
Get-MsolUser -HasErrorsOnly | Format-Table DisplayName,UserPrincipalName,@{Name="Error";Expression={($_.errors[0].ErrorDetail.objecterrors.errorrecord.ErrorDescription)}} -AutoSize
"Exchange can't disable the mailbox, because it is on In-Place Hold."
What I've done for trouble shooting:
1. Give the service account back the license, exclude him from the retention policy, wait till the policy is success and remove the license. No luck.
2. Re provision mailbox with "Redo-MsolProvisionuser -ObjectID". No luck.
3. Follow this great guide: https://masterandcmdr.com/2020/04/24/cannot-delete-a-mailbox-with-retention-policies-enabled/ No luck
In the guide on step 3, they are speaking over a inactive mailbox. My service account is not inactive, it still exist. I just want to delete the mailbox for this service account.
I hope anyone can help me out.
Regards,
Ricardo
9 Replies
That's the expected behavior. If you want to just remove the mailbox without removing the underlying user object, exclude it from the retention policy. Previously it was possible to use the Disable-Mailbox cmdlet with the -IgnoreLegalHold switch, but Microsoft has since removed this functionality as detailed here: https://docs.microsoft.com/en-us/office365/troubleshoot/holds/ignorelegalhold-not-available
- vand3rlindenBrass Contributor
VasilMichevThank you for reaching out on this post 🙂
I have already tried to exclude the userobject from our retention policy, but with no luck. Even after the policy says "success" in the compliance center.
Did you check that nothing of interest is shown under InPlaceHolds, as detailed here: https://docs.microsoft.com/en-us/microsoft-365/compliance/identify-a-hold-on-an-exchange-online-mailbox?view=o365-worldwide