Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am querying an Active Directory to gather the list of people having a given manager. The following search works fine:

$ ldapsearch "cn=John Doe" manager

dn: CN=John Doe,...
manager: CN=The Boss,...

What I would like is to have the right syntax to search for all people reporting to The Boss, something like

$ ldpasearch "<manager's cn is The Boss>" cn

which would return a list, including cn=John Doe (among others)

What is the correct syntax for such filter?

Thank you!

share|improve this question
up vote 0 down vote accepted

You'll want to filter on the manager attribute. However, you'll need to use the full distinguished name of the manager in the filter. For example:

ldapsearch "manager=cn=John Doe,cn=users,dc=domain,dc=name" 1.1

share|improve this answer
Thank you! I tried various things but not the full dn. It works perfectly. – WoJ Dec 20 '13 at 7:43

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.