Extract ldap path for bulk object

We have already seen how to Find distinguished name for single object, if we need to extract distinguished name for bulk object, in some scenario we want to find the ldap path for bulk AD object, like bulk user, bulk OU, bulk Site, bulk Group, bulk Subnet and many more, I will try to list the commands and syntax to complete the extraction

Extract ldap path for bulk object using Dsquery Command

For /f %a in (list.txt) do Dsquery user –name %a >> output.txt

list the user names in list.txt file, and need to run this from same path where the list.txt file located

Get LDAP path for all the users in an OU using CSVDE command

csvde -f “file path” -d “OU LDAP path” -r “(&(objectClass=user)(objectCategory=person))” -l “cn”

You can use the same command for other objects by replacing the filter

For AD Group – (objectcategory=group)

For OU –  (objectCategory=organizationalUnit)

For Computer – (objectCategory=computer)

For Server – (&(objectCategory=computer)(operatingSystem=*server*))

Back to → page 1 2

You can also use the Search AD Object using the Attribute value tool to find the LDAP path, using this tool you can do customized search on Active Directory.

Share On Facebook
Share On Twitter
Share On Google Plus
Share On Linkedin

Leave a Reply

Your email address will not be published. Required fields are marked *