How to get the Active Directory (AD) Distinguished Name (DN) of a user

There are at least two ways to accomplish this goal:

  1. Running the command dsquery user -name ADUSERNAME where ADUSERNAME is the name of the user on the AD
  2. Running the command ldifde -f users.txt where all LDAP data from AD is dumped into the file named users.txt

You may also like