Find LDAP DN of Users and Groups using the Command Line

I always forget this command, so here’s a handy reference (for moi):

Find LDAP Path of… Command
OU dsquery OU –name “OU name”
Group dsquery group –name “Group name”
Username dsquery user –name username
Computer dsquery computer -name computername


Chrissy is a Cloud and Datacenter Management & Data Platform MVP who has worked in IT for over 20 years. She is the creator of the popular SQL PowerShell module dbatools, holds a master's degree in Systems Engineering and is coauthor of Learn dbatools in a Month of Lunches. Chrissy is certified in SQL Server, Linux, SharePoint and network security. You can follow her on Twitter at @cl.

Posted in Active Directory
2 comments on “Find LDAP DN of Users and Groups using the Command Line
  1. Arvinder Singh says:

    Thank you Chrissy. While I went through a lot of other articles giving overwhelming but hard to understand or unnecessary information, you on the other hand were right on spot.

  2. Pawan says:

    Thank you Chrissy

Leave a Reply to Pawan Cancel reply