I am working with a large directory at my company (40000+ accounts). I have a group that has a very large number of members (10000+). I'm following the documented procedure (http://ldapjs.org/client.html) for paging.
I've wrapped the search function in a Promise for ease of use. Here's an excerpt from my function. If you don't see it defined, assume it's provided by the function:
let params = { filter: `(sAMAccountName=${samAccountName})`, scope 'sub', paged: true, sizeLimit: 500 }
return new Promise<SearchResult[]>((resolve, reject) => {
this.client.search(searchBase, params, (error, response) => {
if (error) return reject(error);
response.on('page', () => {
console.log('page end');
});
response.on('searchEntry', (entry: SearchResult) => {
// definitions are not yet available for 3.*
//@ts-ignore
results.push(entry.pojo);
});
response.once('end', () => {
return resolve(results);
});
});
});
When I execute the search for my group that has a memberOf field containing 10000+ members, I see the "page end" text print once and then I get a result containing a field called member;range=0-1499. First off, I set the pageSize to 500, not 1500. Second, I know for a fact that that there are more than 1500 group members. In the past, I used the manual method of adjusting the ldap calls to use that attribute, parse it, and walk it out until it came back with a '*' in the range, i.e. member;range=1500-2999, member;range=3000-*. This works but I had to write a custom recursive function to do it, and it's even more complicated when you have nested groups that you need to flatten into members who are users. Paging doesn't appear to do anything except tell you that there is a page.
What am I missing?
I am working with a large directory at my company (40000+ accounts). I have a group that has a very large number of members (10000+). I'm following the documented procedure (http://ldapjs.org/client.html) for paging.
I've wrapped the search function in a Promise for ease of use. Here's an excerpt from my function. If you don't see it defined, assume it's provided by the function:
When I execute the search for my group that has a memberOf field containing 10000+ members, I see the "page end" text print once and then I get a result containing a field called
member;range=0-1499. First off, I set the pageSize to 500, not 1500. Second, I know for a fact that that there are more than 1500 group members. In the past, I used the manual method of adjusting the ldap calls to use that attribute, parse it, and walk it out until it came back with a '*' in the range, i.e.member;range=1500-2999,member;range=3000-*. This works but I had to write a custom recursive function to do it, and it's even more complicated when you have nested groups that you need to flatten into members who are users. Paging doesn't appear to do anything except tell you that there is a page.What am I missing?