I am trying to get all the groups that a certain user is a member of.
I have the following structures in ldap:
l = ldap.initialize("ldap://my_host")
ldap_result = l.search("[BASE_DN]", ldap.SCOPE_SUBTREE, "(&(objectClass=Person)(cn=ann))", None)
res_type, data = l.result(ldap_result, 0)
results = l.search_s([BASE_DN], ldap.SCOPE_SUBTREE, search_filter, ['cn',])
member=cn=ann is not enough. You have to use ann's full DN, probably something like this: