How to find the Active Directory Path

I was trying to complete an audit of a server and needed a quick way to generate a list of users alongwith their appropriate group and stumbled on a command line tool called dsquery.

If you are working with command line tools to manage the active directory then it is very helpful to identify the fully qualified Distinguished Name (DN).  Using the dsquery command it is very simple to find the DN. The full reference guide to the dsquery command and available options is available at Technet’s Dsquery Guide.

However, as a quick sample, try the following:

1) Open a command prompt

2) Type:

dsquery user -name Leonard*

3) Press Enter

You should see a list of all the users in the directory with the full DN or Active Directory path as listed below:

“CN=Leonard Nelson,OU=something,OU=something-branch,OU=Organization,DC=subdomain,DC=domain,DC=topleveldomain”

2 Replies to “How to find the Active Directory Path”