Score:0

Is it possible to fully undelete an Azure AD hybrid user account? If so, how?

tr flag

Whereas this article says a deleted AD user only needs to be restored from the recycle bin for its Azure AD object to aslo be restored. For us, when an AD user object is undeleted, Azure AD Connect thinks it must provision (create anew) an Azure AD object, throwing the error, "InvalidHardMatch: Another cloud created object with the same source anchor already exists in Azure Active", when it finds the matching object in Azure AD in the recycle bin. I have also tried restoring the AAD object both before and after restoring the AD object.

When the AAD object is permanently deleted, the AD account will synchronize successfully.

With a new AAD object, I would rebuild their AAD account, then copy the contents of their original mailbox to the new mailbox. However, the user's original mailbox is permanently deleted by Exchange when their original ExchangeGuid is synced from AD.

What is the proper way to restore a deleted Azure AD Hybrid User account? If it should be as simple as restoring the AD object, could our Azure Connect be misconfigured?

1/22/2023: It is looking as though this may be a problem specific to our environment. If someone would please confirm that a deleted AD account only needs to be undeleted for Azure Connect to restore and sync the corresponding Azure AD object, I will close this question.

tr flag
Why the down vote? What could I improve?
SamErde avatar
gg flag
Did you ensure that the user was restored to a synced OU?
tr flag
Never changes OU. Once restored in AD, Connect treats it like a new object. Then complains when it finds an EXACT Hard Match in AAD, when it tries to provision this "new" account. When, documentation and Microsoft support say it should sync. Support has asked us to re-install Connect. However, right now is not a good time. So, our case was just put on hold.
Score:1
br flag

You must do Hard Match Microsoft 365 Identities to your On-Premises User: Provided below is the step-by-step guide on how to carry out this solution:

  1. Remove on-premise Identity from syncing with O365

  2. Remove on-premise Identity from O365 and Remove from Recycle bin

  3. Launch Powershell and run the following Commands

    a. Set-ExecutionPolicy RemoteSigned

    b. $credential = Get-Credential

  4. Input admin credentials for Office 365 and run the following command Import-Module MsOnline

  5. Connect-MsolService -Credential $credential

  6. Run $ADGuidUser = Get-ADUser -Filter * | Select Name,ObjectGUID | Sort-Object Name | Out-GridView

  7. Select the on-premise user from the Grid

  8. Run $UserimmutableID = [System.Convert]::ToBase64String($ADGuidUser.ObjectGUID.tobytearray()) in powershell to convert GUID to the immutable ID format

  9. Run $OnlineUser = Get-MsolUser | Select UserPrincipalName,DisplayName,ProxyAddresses,ImmutableID | Sort-Object DisplayName | Out-GridView -Title "Select The Office 365 Online User To HardLink The AD User To" -PassThru

  10. Select the Online identity to match on-premise identity

  11. Run Set-MSOLuser -UserPrincipalName $OnlineUser.UserPrincipalName -ImmutableID $UserimmutableID

  12. Set the Online identity with the new immutable ID

  13. Run Set-MSOLuser -UserPrincipalName $OnlineUser.UserPrincipalName -ImmutableID $UserimmutableID

  14. Check the immutable id matches

  15. Run the following two lines and confirm IDs Match

    Write-Host "AD Immutable ID Used" $UserimmutableID

    Write-Host "Office365 UserLinked" $Office365UserQuery.ImmutableId

Source: https://www.akinsit.com/how-to-hard-match-office-365-identities-to-on-premise-users

Hope this helps!

tr flag
Thank you. I will try this. However, I have already verified that the Immutable ID calculated from the on-prem ObjectGUID matches the AAD object's. Maybe the act of re-setting it will cause it to sync, rather than attempt to provision? In line 1, I assume you mean undelete the AD object and move it to an un-synced OU. Line 2, I assume you mean undelete the AAD object. Also, are lines 11 and 13 supposed to be duplicates?
mx flag
I do feel the same way as you that restoring on-prem user object should automatically restore its counterpart in AAD. Asking customer to perform a manual hard match doesn't make sense - it could be built into ADC logic
tr flag
The source anchor calculated from the on-prem AD Object GUID matches the on-prem mS-DS-ConsistencyGuid property, which matches the Azure AD Immutable ID. Setting the Azure AD Immutable ID to its same value does not improve matters. ☹️
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.