Tag Archives: Python

Python-LDAP: List the Group Membership of a User

Python-LDAP: List the Group Membership of a  User

Unless your an LDAP expert it’s not obvious how to find the groups a user is member of, and that also describes how you need to tackle this problem.

This code makes a lot of assumptions and also assumes that a user’s UID is named ‘uid’.

If there’s a better way to do this, let me know.

References:
This thread on the Python-LDAP mailing list was quite useful: