Changing LDAP Query size limit more than 1000

In PHP, you may get this warning (Warning: ldap_search(): Partial search results returned: Sizelimit exceeded in) when more than 1000 objects returned in single search, you can change using following guide:

  1. Open Command Prompt on a domain controller (You must use admin credentials)
  2. Type NTDSUTIL and press ENTER.
  3. In the ntdsutil: prompt, type ldap policies
  4. In the ldap policy: prompt, type connections
  5. In the server connections: prompt, type connect to server <FQDN of domain controller> (example: connect to server domain1.com)
  6. Once you are connected, type q to come back to the ldap policy: prompt.
  7. To change the value to allow up to 5,000 objects to be returned in a single LDAP query, type set MaxPageSize to 5000
  8. To commit changes type commit changes
  9. If you type show values, you can see the current value for the administration limits, including the MaxPageSize limit

Leave a Reply