PowerAddict.net

powerAddict.NET

by Lou Goban
IT Application Professional at Syntax

How to find out/verify onprem AD OU location in Azure AD for synced user

First we need ObjectID of Azure AD user, so connect to Azure AD and run (I used email address as SearchString:

(Get-AzureADUser -SearchString "<emailAddress>").ObjectID

Next, let’s find out onPremiseDistinguishedName:

(Get-AzureADUser -objectid <id from first step>).ExtensionProperty["onPremisesDistinguishedName"]

Output will be DistinguishedName of the user.

Leave the first comment