Error Exchange: An unknown error has occurred

Facing an unknown Exchange error when opening an user object in the admin portal? This is how you could solve it.


Root case

When opening an user in the admin portal, you see: Error Exchange: An unknown error has occurred. Sadly, we cannot do anything with an unknown error. Because it do not show exactly what is going wrong with the user object. You can get the exact error message with the following command with the MsolService module in PowerShell.

Get-MsolUser -HasErrorsOnly | fl DisplayName,UserPrincipalName,@{Name="Error";Expression={($_.errors[0].ErrorDetail.objecterrors.errorrecord.ErrorDescription)}}

After running this you will find the exact error for that user object and maybe you find more users with the explanation of an unknown error.

Possible resolution

Whatever message you get, you can always try to provision the mailbox again with he following commands in the MsolService module.

Get-MsolUSer -Userprincipalname "user@domain.com" | Select-Object *ObjectID*

Copy the ObjectID.

Redo-MsolProvisionuser -ObjectID "XXXXXX-XXXX-XXX-XXXX-XXXXXXXXXXX"

This is save to do, the mailbox will provision again with all the data and settings.

Holds in Exchange Online

It is not supported* to remove an Exchange license when a mailbox is under hold. When you have this situation, you will face the unknown Exchange error. To solve this open your active retention policy in the Microsoft 365 Compliance Center, exclude the user object from that policy. But before that, give the user an Exchange Online license, you should see that the error is gone. Now exclude the user object from your retention policy and save it. When the retention policy say success, remove the Exchange Online license from the user object, then remove the exclude from the retention policy and the error should not appear anymore.

*Keep in mind, that you do not do this for a normal user object. Is not legal to delete a hold, while the mailbox is under a hold. This is against the compliance rules from a company. In my scenario I aim on a service account that have a temporary Exchange Online license. The best way is to exclude that service account from the retention policy before you assign a temporary license.


Share this: