title: How to retrieve all OU of Active Directory in LDAP?
body: <p>I am using ldap3. I want to retrieve all Organizational units of AD.
  Here is my code</p>
  
  <pre><code>from ldap3 import Server, Connection, SUBTREE, ALL
  total_entries = 0
  
  s = Server('172.30.1.197', port=636, use_ssl=True, get_info=ALL)
  admin_username = "Administrator@naanal.local"
  admin_password = "p@ssw0rd1"
  c = Connection(s, user=admin_username, password=admin_password)
  c.bind()
  c.start_tls()
  
  c.search(search_base = 'dc=naanal,dc=local',
           search_filter = '(objectClass=OrganizationalUnit)',
           search_scope = SUBTREE,
           paged_size = 5)
  
  total_entries += len(c.response)
  
  for entry in c.response:
      print(entry)
  
  print('Total entries retrieved:', total_entries)
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>{'dn': u'OU=Domain Controllers,DC=naanal,DC=local', 'attributes': {}, 'raw_attributes': {}, 'type': 'searchResEntry'}
  {'dn': u'OU=Police,DC=naanal,DC=local', 'attributes': {}, 'raw_attributes': {}, 'type': 'searchResEntry'}
  {'dn': u'OU=dummy,DC=naanal,DC=local', 'attributes': {}, 'raw_attributes': {}, 'type': 'searchResEntry'}
  {'type': 'searchResRef', 'uri': ['ldaps://ForestDnsZones.naanal.local/DC=ForestDnsZones,DC=naanal,DC=local']}
  {'type': 'searchResRef', 'uri': ['ldaps://DomainDnsZones.naanal.local/DC=DomainDnsZones,DC=naanal,DC=local']}
  {'type': 'searchResRef', 'uri': ['ldaps://naanal.local/CN=Configuration,DC=naanal,DC=local']}
  ('Total entries retrieved:', 6)
  </code></pre>
  
  <p>What is the last three entries in the result ? Why is it coming ?</p>