Powershell – Office 365 In-Place Hold preventing me from deleting user

exchangemicrosoft-office-365powershelltroubleshooting

I am using AD Connect to synchronize my on-premises Active Directory to our Office 365 tenant. I tried disabling a user from on-premises and then synchronizing to O365. However, it seems to have broken everything because nothing is synchronizing any longer and the user still exists in O365.

When I open the user properties in O365 admin, I see the following error:

Exchange: An unknown error has occurred. Refer to correlation ID:
769ccf2f-bd09-4651-801e-983aaeaace7f;

If I try to run Get-MsolUser I get the following error:

Exchange can't disable the mailbox "ZZZZ.PROD.OUTLOOK.COM/Microsoft
Exchange Hosted Organizations/domain.onmicrosoft.com/UserName" because
it is on In-Place Hold.

I can't find any In-Place Hold policy active and I can't seem to be able to delete this user. I even tried running Remove-MailUser and got the error:

The operation couldn't be performed because object 'user@domain.com'
couldn't be found on 'YYYY.ZZZZ.PROD.OUTLOOK.COM'.

Best Answer

Try to sync the objector manually and check if you will receive any error:

Azure AD Connect sync: Scheduler https://docs.microsoft.com/en-us/azure/active-directory/connect/active-directory-aadconnectsync-feature-scheduler

And try to reactive this account and disable it again.