Page 1 of 1

ldap_search() ActiveDirectory and 1000+ records

Posted: Tue Mar 21, 2006 4:02 pm
by hanji
Hello

I'm running into an odd problem.. and I'm not sure how to work correct this. I currently have an application that does LDAP queries against Active Directory. Currently, I need to fill a locations dropdown with 'unique' locations of all the users. As far as I can tell there are no DISTINCE or unique handling via LDAP filters to get this. So my solution (which I don't like) is to query LDAP and return all users, then feed them into an array, but only if the location is not in the array.. uck. This leads to the second problem.. Active Directory only returns 1000 records as a maximum. I've seen multiple references of this with ASP, and the solution was to introduce 500 record pages, but ASP queries LDAP using recordset objects, and adjusting the 'Page Size' property of that object. I'm not sure how to make this work using PHP's LDAP functionality. I've played with the ldap_search() and including sizelimit variable, but that only overrides if it's less than the server setting. So I can't push it over 1000, etc.

Has anyone experienced this problem with AD? Anyone know of a better way to return unique locations via filter? The attribute I'm trying to get uniquely is 'l' for 'location'.

I can provide code if needed, but I think this is a function setting or filter string that needs to be adjusted. Let me know if you need to see my example.

Thanks in advance.
hanji