Query users and/or groups DN from Active Directory.

Because basic LDAP query is out of MS' scope...


Author(s): Tamas Bures | Created: 17 April 2019 | Last modified: 25 June 2022
Tested on: -

Query users and/or groups DN from Active Directory.

  1. Open a Windows Command Prompt.
  2. Use the following command:

Users

dsquery user -name <known username>

For example:

dsquery user -name A*

Example output:

dsquery user -name A*

"CN=Administrator,CN=Users,DC=hu,DC=ibm,DC=isec,DC=com"
"CN=Alison Greene,CN=Users,DC=hu,DC=ibm,DC=isec,DC=com"

Groups

dsquery group -name <known group name>

For example:

dsquery group -name A*

Example output:

dsquery group -name A*

"CN=Administrators,CN=Builtin,DC=hu,DC=ibm,DC=isec,DC=com"
"CN=Access Control Assistance Operators,CN=Builtin,DC=hu,DC=ibm,DC=isec,DC=com"
"CN=Account Operators,CN=Builtin,DC=hu,DC=ibm,DC=isec,DC=com"
"CN=Allowed RODC Password Replication Group,CN=Users,DC=hu,DC=ibm,DC=isec,DC=com"