mylifeinaminute.com

Using DSQUERY to find distinguished names in Active Directory

by liquidpooled on Nov.20, 2008, under Microsoft, TechNet

If you ever need to find the distinguished name of a user in Active Directory, you can use the following DSQUERY command.


DSQUERY.exe * -limit 0 -filter "(&(objectCategory=Person)(objectClass=User)(!userAccountControl:1.2.840.113556.1.4.803:=2))" > "c:\activeUsers.txt"

The above command will output all of the active users in the current login name to a text file called activeUsers.txt in the root of the C: drive.

:,
No comments for this entry yet...

Leave a Reply

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...