powered by Jive Software

Only pulling a partial user list with 3.6.4 + MS AD .. believe issue with LDAP paged size

Recent stood up a 3.6.4 server on W2K3 and whle the query is working fine it is only pulling the first 1000 uses which magically corresponds to the undocumented code value ldap.pagedResultsSize=1000. Adding a custom value to the config xml (ldap.pagedResultsSize=10000) does’t seem to help. Ideas? I also am not hitting the 10,000 limit as only ~3000 users.

Thanks -Peter

This is an active directory limitation. AD will only return the first 1000 of a query. This is set by maxpagesize limit of ad: http://support.microsoft.com/kb/315071

Right except I thought in OF 3.6.0 they allow multi-paged queries. See http://www.igniterealtime.org/issues/browse/JM-1117

Here are the steps I did to change the setting on my ADAM instance; the same should work for the full blown AD. Note that this will affect everything connecting to AD, not just Openfire.

  1. Using (ADAM) ADSI Edit…
  2. Connect to the “Well-known naming context” named “Configuration”
  3. Log on to ADAM with an account that has administrative rights, i.e. is a member of the CN=Administrators,CN=Roles,DC=company,DC=com group
  4. Navigate to the following
  5. CN=Services >
  6. CN=Windows NT >
  7. CN=Directory Service >
  8. CN=Query-Policies >
  9. CN=Default Query Policy
  10. On the multi-valued property IDAPAdminLimits
  11. Change the entry MaxPageSize
  12. The default value is 1000
  13. Set this to 10000 (i.e. 10,000) (or whatever)
  14. Apply the changes.

Adding a custom value to the config xml (ldap.pagedResultsSize=10000) does’t seem to help
Actualy I think that you have to set ldap.pagedResultsSize below 1001.

ldap.pagedResultsSize=500
It means that records will be read on chunks by 500 until end of result reached. So in your case 3000/500 = 6 pages.

In order to work you will need to:

  1. Go to Server::Server Manager::System Properties::Add new property
    Property Name: ldap.pagedResultsSize
    Property Value: 1000
  2. Download source, apply patch, recompile.

There is optional patch that allow retrieving all users(at a single page) in admin interface, also add 500 and 1000 results per page.

Message was edited by: Milan Enev

ldap.pagedResultsSize.patch.zip (1195 Bytes)

Hi Milan,

is this a “public domain” patch? I’d like to appy it to Openfire (admin interface). The other one I did optimize further.

old code:

try {
    if (pageSizeStr != null) pageSize = Integer.parseInt(pageSizeStr, -1);
}
catch (NumberFormatException e) {
    // poorly formatted number, ignoring
}
new code (first test, then try/catch):
if (pageSizeStr != null)
    {
    try {
        pageSize = Integer.parseInt(pageSizeStr); /* radix -1 is invalid */
    }
    catch (NumberFormatException e) {
        // poorly formatted number, ignoring
    }
}

LG

Absolutely.

Cheers

Milan

OF-368 (fixed in 3.7.0)

thanks for providing the patch

LG