0

I need to extract all the people managed by a particular manager ("report"). Each person has a "manager" attribute which point to the manager. I can search on the manager attribute - but this only finds direct reports. If we have a second-level manager, it doesn't find their whole team.

I realise I can use the search query repeatedly, but this could get slow when people have a large team. Especially as I don't know if a particular user is a manager or not - until I do the search query.

Is there a single LDAP query to fetch all the reports? I'm using openldap. A similar kind of query is possible in SQL using CONNECT BY or WITH RECURSIVE.

paj28
  • 2,210
  • 3
  • 25
  • 37

1 Answers1

1

Using Lightweight Directory Access Protocol (LDAP) in openLDAP and most LDAP implementations you have no choice but to do repeated LDAP Queries. (Note the word Lightweight )

Microsoft Active Directory has a really neat Extensible Matching Rule they call LDAP_MATCHING_RULE_IN_CHAIN which can be used for such purposes, but, it only works on Microsoft Active Directory.

jwilleke
  • 10,467
  • 1
  • 30
  • 51
  • Hey Ok. But is there any way by using `grep` and some repeated queries manually. – Rigin Oommen Nov 05 '18 at 12:14
  • Of course there is always a way. Tell us what you have tried and show logs or results and Read: https://stackoverflow.com/help/how-to-ask – jwilleke Nov 05 '18 at 12:36