[python-ldap] Can i check if the group exist in active directory using python ldap

Michael Ströder michael at stroeder.com
Fri Sep 9 09:29:21 EDT 2016


Sebastian Wiesner wrote:
> the actual filter string for "user in group exist" depends on which LDAP object
> is holding this information inside which attribute, so please provide further
> information. Provided your group RDN part is cn=<group name>,ou=Group your
> filterstring for verifying a special group exists is as follows:
> 
> (&(ou:dn:=Group)(cn=<group name>))

With this filter you're assuming that the string "ou=Group" is a component of
the group entry's DN. This is wrong in most cases.

Should rather be:

(&(objectClass=group)(cn=<group name>))

Ciao, Michael.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4245 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://mail.python.org/pipermail/python-ldap/attachments/20160909/068b7d57/attachment.bin>


More information about the python-ldap mailing list