March 2019
Beginner
490 pages
12h 40m
English
To find entries in the ldap directory, you must use the search operation. This operation has a number of parameters, but only two of them are mandatory:
conn.search(search_base,search_filter, attributes)
The following are the parameters:
In this script, we are going to search all users in the FreeIPA demo LDAP server. You can find the following code in the entries_ldap_server.py file:
#!/usr/bin/env python3from ldap3 import Server, Connection, ObjectDef, AttrDef, Reader, Writer, ALLLDAP_SERVER ="ipa.demo1.freeipa.org"LDAP_USER ="uid=admin,cn=users,cn=accounts,dc=demo1,dc=freeipa,dc=org" ...Read now
Unlock full access