# import class and constants
from ldap3 import Server, Connection, ALL, SUBTREE
# define the server
s = Server(host='xyz', port=xxxx, use_ssl=True, get_info='ALL')
c = Connection(s, auto_bind='NONE', version=3, authentication='ANONYMOUS', client_strategy='SYNC', auto_referrals=True, check_names=True, read_only=False, lazy=False, raise_exceptions=False)
c.bind()
results = c.extend.standard.paged_search(
search_base = 'Ou=XYZ,dc=org,dc=com',
search_filter = '(AppID=*)',
search_scope = SUBTREE,
get_operational_attributes=True,
attributes=['*'],
generator=True,
paged_size=None
)
i=0
for entries in results:
print(entries)
i+=1
print(i)
I am trying to connect to a server on a specific port and doing an ANONYMOUS SSL authentication. I have written the above script to get the results for "AppID=*". I am only able to print 1000 records and after that I run into the following error:
Traceback (most recent call last): File "C:/Fetch data.py", line 43, in for entries in results: File "C:\Users\xyz\AppData\Local\Programs\Python\Python36\lib\site-packages\ldap3\extend\standard\PagedSearch.py", line 75, in paged_search_generator raise LDAPOperationResult(result=result['result'], description=result['description'], dn=result['dn'], message=result['message'], response_type=result['type']) ldap3.core.exceptions.LDAPSizeLimitExceededResult: LDAPSizeLimitExceededResult - 4 - sizeLimitExceeded - None - None - searchResDone - None
I have tried the solutions provided Conquering Active Directory's 1000 record limit
I have tried going through the document LDAP3 Docs but no success. Is there a way to read complete output. (I imagine there are more than 5k records)