LDAP: How get all users belongs to a group.

Michael Ströder michael at stroeder.com
Fri Jun 24 05:14:47 EDT 2011


sajuptpm wrote:
> How get all users belongs to a group using python ldap module.

There are several ways of storing grouping information in a LDAP server.

I assume the groups are normal group entries of object class 'groupOfNames'
which is most commonly used. Such an entry has the attribute 'member' which
contains DNs of all member entries which you would have to read yourself. This
can be quite annoying for large group entries since you would have to send a
search request for each group member.

Therefore on some servers you can search for a back-link attribute in the user
entries. Most times it's called 'memberOf' or 'isMemberOf'. But this depends
on the server's implemented features and configuration.

Which LDAP server are you using?

Ciao, Michael.



More information about the Python-list mailing list