how to query active directory-dsget-dsquery commands

Discssu about active directory issues, backup, troubleshooting, replication issues etc..

how to query active directory-dsget-dsquery commands

Postby Praveen » Tue May 26, 2009 2:33 pm

how to query a group in Active directory for finding its location and OU, just say the group name is starting with domain*
Syntax: dsquery group [{<StartNode> | forestroot | domainroot}]
[-o {dn | rdn | samid}] [-scope {subtree | onelevel | base}]
[-name <Name>] [-desc <Description>] [-samid <SAMName>]
[{-s <Server> | -d <Domain>}] [-u <UserName>]
[-p {<Password> | *}] [-q] [-r] [-gc]
[-limit <NumObjects>] [{-uc | -uco | -uci}]

Eg: if you search "domain admins" group in AD
then,
Code: Select all
dsquery group dc=kannade,dc=com -name domain*

now you will get the location eg:
Code: Select all
"CN=Domain Admins,CN=Users,DC=kannade,DC=com"

then use dsget command to find the list of members in the domain admins,
Code: Select all
dsget "CN=Domain Admins,CN=Users,DC=kannade,DC=com" -members

this will display the list of members in the domain admin group.
User avatar
Praveen
Site Admin
 
Posts: 84
Joined: Sat Apr 25, 2009 2:21 pm

Return to Active Directory

Who is online

Users browsing this forum: No registered users and 0 guests