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”
dsquery is not installed on our server. Is there any other to do the same thing?
This worked like a charm. Thanks!
Comments are closed.