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.
0 Comments.