Find User DNMany command takes full user DN as option. Below command find user DN those names start with “Smith”. ‘*’ is the wildcard character and can be used anywhere in the string.
dsquery user -name "Smith*"
Find Group DNSimilar to user DN:
dsquery group -name "MyGroup*"
List Users In GroupUse command below to find all users in a given AD security group. Replace <groupDN> with actual group DN.
dsget group <groupDN> -members | find /i "cn=users"
List All Groups Who Is a Member OfUse command below to find all the group a given AD name belongs to. Replace <DN> with actual user DN or group DN.
dsget user <DN> -memberof