ldap_search(): Partial search results returned: Sizelimit exceeded

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Perhaps mistakenly for a project that I am trying to do I want to list
all users in the Active Directory. It works pretty well with one
exception, the error ldap_search(): Partial search results returned:
Sizelimit exceeded.

Now, I know that I can page through (I would have to figure out a clever
way to display to the user) these.

I have read some stuff that says the limit is hard coded in AD, so there
is no way around it. I just wanted to check with you folks to see if you
had any clever ideas on how to work around this.

TVMIA!

$username = $_SESSION['user'];
$password = $_SESSION['password'];
if(!$ds=ldap_connect("172.17.16.161")){
	echo "did not connect...please contact system administrator or
go back to try again";
}

$un = "foobar\\".$username;
ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_set_option($ds, LDAP_OPT_REFERRALS, 0);
ldap_set_option($ds, LDAP_OPT_SIZELIMIT, 2000);
if(!$r=ldap_bind($ds, $un, $password)){
    echo 'You are not authorized and or, your login information was
incorrect';
} else {
	$sr=ldap_search($ds, "dc=domain, dc=local", "mailnickname=");
    $info = ldap_get_entries($ds, $sr);
	$sr= ldap_search($ds, "dc=domain, dc=local", "mailnickname=*");
	$info = ldap_get_entries($ds, $sr);
	echo count($info) . "<br />";
	for ($i=0; $i<count($info); $i++) {
    	echo $info[$i]["mailnickname"][0] . "<br />";
    	
	}

}

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux