Hassan Anwer
Hassan Anwer

Reputation: 367

OU Information Not Available In Azure After Syncing User From On Prem Active Directory

I have created one organizational unit inside my active directory and added a user inside that OU.

DistinguishedName : CN=Alex Shaun,OU=TestOU,DC=mydomain,DC=com
Enabled : True
GivenName : Alex Name : Alex Shaun
ObjectClass : user ObjectGUID : 16fc9afc-02a5-474f-8837-4e71853y1ceb
SamAccountName : alex SID : S-1-5-21-233531163-xxxxxxx-2764101054-1604
Surname : Shaun
UserPrincipalName : [email protected]

After doing I synced that user into my azure using azure ad connect. Now I am using Microsoft Azure API to get user information but it does not contain any information regarding OU.

        {
        "businessPhones": [],
        "displayName": "Alex Shaun",
        "givenName": "Alex",
        "jobTitle": null,
        "mail": null,
        "mobilePhone": null,
        "officeLocation": null,
        "preferredLanguage": null,
        "surname": "Shaun",
        "userPrincipalName": "[email protected]",
        "id": "xxxx-0744-47cb-ad48-xxxxxxxx"
    },

Upvotes: 1

Views: 803

Answers (2)

lijevosmetalo
lijevosmetalo

Reputation: 99

You can fetch onPremisesDistinguishedName property which contains OU.

It is returned only on $select. https://graph.microsoft.com/v1.0/users?$select=onPremisesDistinguishedName

Upvotes: 0

RamaraoAdapa
RamaraoAdapa

Reputation: 3119

Azure Active Directory is a flat structure containing user, groups & computer objects

Azure Active Directory does not have OUs

So, you would not be able to see OU information in the Azure Active Directory

Upvotes: 1

Related Questions