How we can sync windows account name from Onpremises to Azure AD?

raj a 316 Reputation points
2021-10-13T17:15:16.953+00:00

We have Azure AD connect to sync objects from On-premises Active Directory to Azure AD & want to sync the Windows Account Name (Domain\samaccountname) to azure AD.

Is it possible to sync Windows Account Name (Domain\samaccountname) to azure AD?

Can anyone please advice how we can do that?

Thanks much.

Microsoft Security Microsoft Entra Microsoft Entra ID
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Marilee Turscak-MSFT 37,206 Reputation points Microsoft Employee Moderator
    2021-10-20T22:10:19.047+00:00

    Azure AD Connect synchronizes the on-premises SamAccountName to Azure AD as OnPremisesSamaccountName, and it's mapped to "accountName" in the metaverse.

    For the newer versions of Graph API, it's exposed using either of these calls in Graph Explorer:

    https://graph.microsoft.com/v1.0/users/synceduser@example.com?$select=onPremisesSamAccountName  
    
    https://graph.microsoft.com/beta/users/synceduser@example.com  
    

    Related threads, for reference:
    https://learn.microsoft.com/en-us/answers/questions/95273/how-to-add-samaccountname-as-a-soirce-attribute-in.html

    https://social.msdn.microsoft.com/Forums/en-US/e400c1c8-c803-4af1-8a90-0a1ff246f844/samaccountname-attribute-in-azure-ad?forum=WindowsAzureAD

    Let me know if this helps.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.