ldap-query

How should I escape ldap special characters?

How should I escape ldap special characters? Question: I’m using python-ldap to query Active Directory I have this DN CN=Whalen, Sean,OU=Users,OU=Users and Groups,DC=example,DC=net That works fine as a base in a query, but if I try to use it in a search filter like this (&(objectClass=group)(memberof:1.2.840.113556.1.4.1941:=CN=Whalen, Sean,OU=Users,OU=Users and Groups,DC=example,DC=net)) I get a Bad search filter …

Total answers: 2

LDAP query in python

LDAP query in python Question: I want to execute the following query in the ldap ldapsearch -h hostname -b dc=ernet,dc=in -x “(&(uid=w2lame)(objectClass=posixAccount))” gidnumber ldapsearch -h hostname -b dc=ernet,dc=in -x “(&(gidNumber=1234)(objectClass=posixGroup))” cn And use the variables thus obtained. How can I do that? Asked By: w2lame || Source Answers: you can use the commands module, and …

Total answers: 5