I need to list all members of all groups, where a given user (or a small group of users) are members.
The straightforward way to do it is to get the list of groups from the memberOf
-attribute of the seed-user(s) and loop through them collecting their other members.
But, perhaps, there is some better way -- with advanced LDAP -- to do it in fewer (or even just one) query?
If it matters, I'm talking to Active Directory from a PHP-script using the ldap-extension. Thanks!