Hello,
Thanks for your question.
From reviewing the issue, I see the problem lies in that Entra ID account was restored, but its userPrincipalName was changed, and the old immutable ID was retained.
I'd recommend the following:
- Check if the immutable ID in the Entra ID is still referencing the old on-premises AD account. If so, it needs to be updated or removed to match the new account. You can use: https://learn.microsoft.com/en-us/graph/api/user-get?view=graph-rest-1.0&tabs=http
- Once you confirm this, to fix:
Set-MsolUser -UserPrincipalName <UPN> -ImmutableId $null
- Rerun sync on Entra Connect
If the above information was helpful please remember to mark 'Accept Answer' and 'Upvote'
Regards,
Abiola