I am getting an ldap.SIZELIMIT_EXCEEDED error when I run this code:
import ldap
url = 'ldap://<domain>:389'
binddn = 'cn=<username> readonly,cn=users,dc=tnc,dc=org'
password = '<password>'
conn = ldap.initialize(url)
conn.simple_bind_s(binddn,password)
base_dn = "ou=People,dc=tnc,dc=org"
filter = '(objectClass=*)'
attrs = ['sn']
conn.search_s( base_dn, ldap.SCOPE_SUBTREE, filter, attrs )
Where username is my actual username, password is my actual password, and domain is the actual domain.
I don’t understand why this is. Can somebody shed some light?
Manual: http://www.python-ldap.org/doc/html/ldap.html
I think your best bet here is to limit the
sizelimiton the message you receive from the server. You can do that by setting the attributeLDAPObject.sizelimit(deprecated) or using the sizelimit parameter when usingsearch_ext()You should also make sure your bind was actually successful…