ldapsearch example in python-ldap?

Michael Ströder michael at stroeder.com
Thu Nov 23 17:11:03 CET 2006

Nico Grubert wrote:
> on a linux machine I am running this ldapsearch from the command line:
> ldapsearch -x -h myldaphost.mydomain.com \
>   -D "CN=ldapuser,CN=Users,DC=mydomain,DC=com" -w "secret" \
>   -b "CN=ANYCOMPUTER,CN=Computers,DC=mydomain,DC=com"
> How can I do this with python-ldap?

http://python-ldap.sourceforge.net/docs.shtml contains some links to

This command above boils down to:

r = l.search_s(
  ldap.SCOPE_SUBTREE, # this is the default of ldapsearch

But you really should learn more about it by diving into:


Ciao, Michael.

More information about the Python-list mailing list