Find distinguished name (LDAP path for the object)
9 June 2009
If you are working with command line tools to manage the active directory then you will require a LDAP path as an input for the commands (like dsget, dsmod), how to find the ldap path? or ldap dn
There is a simple way to find the ldap dn using the Dsquery command
Command to find the LDAP path for OU
Dsquery OU –name "OU Name"
Command to find the LDAP path for group
DSquery group –samid "Group Name"
Command to find the LDAP path for user object
Dsquery OU –name "User Name"
Command to find the LDAP path for computer object
DSquery Computer –name "Computer Name"
Command to find the LDAP path for subnet object
dsquery subnet -name "Subnet"
Command to find the LDAP path for the Site
dsquery site -name "Site Name"
You can also use the Search AD Object using the Attribute value tool to find the LDAP path, using this tool yoo can do customized search on Active Directory.
Subscribe to Windowstricks by E-mail to get the free updates and free tools
Related Articles
how to find the ldap path
List active directory group members
find distinguished name
Search object using Attribute in Active Directory
Share this . . .


4 comments:
Hi ,
You are doing a wonderful job and thank you very much for your selfless service
I think the command for getting distinguishe name should be corrected as dsquery user -samid "username"
Hi,
Thanks for your comments, it’s depends on the input, if you have the CN value, you can use the –name, if you have the samid then you can use the –samid.
Genesh,
You are amazing!!
thanks for the useful commands. Please give an example for each of them to understand better rather than abstract names.
Post a Comment