Zhang Huangbin wrote: > On Nov 15, 2010, at 1:16 PM, Jahidul Hasan wrote: >> I need to find those groups name which contains the word "ABC", is it >> possible ? >> >> base_dn = 'CN=ABC,OU=Common,DC=test,DC=com' >> ldapConn.search_s(base_dn, ldap.SCOPE_SUBTREE) >> >> Can I use %ABC% ?
Not in base_dn. > LDAP search filter can be wild-card, use '*ABC*' instead. > > Reference: http://www.zytrax.com/books/ldap/apa/search.html The code snippet of the original poster above does not contain a search filter at all. So additionally he should read: http://www.python-ldap.org/doc/html/ldap.html#ldap.LDAPObject.search ldapConn.search_s(base_dn, ldap.SCOPE_SUBTREE,filterstr='cn=*abc*') Ciao, Michael. ------------------------------------------------------------------------------ Lotusphere 2011 Register now for Lotusphere 2011 and learn how to connect the dots, take your collaborative environment to the next level, and enter the era of Social Business. http://p.sf.net/sfu/lotusphere-d2d _______________________________________________ Python-LDAP-dev mailing list Python-LDAP-dev@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/python-ldap-dev