fritz1968 has asked for the wisdom of the Perl Monks concerning the following question:

How do I perform an LDAP search and limit the number of entries that are found in the search?

I want to perform a search that I know will return 500,000+ entries. However, I only want to return 2 to 3 entries at a time for now (testing/modifying the script), and 500 when I go live with the script.

Any way to limit the number returned in the search? Here is what i have so far:
my $ldap = Net::LDAP->new ( "$idvServer" ) or die "$@"; my $result = $ldap->bind ( "$idvAdmin", password => "$idvPW", version => 3 ) or die($result->error());

my $searchMesg = $ldap->search (base => $userBase, filter => $filter, scope => "$scope", attrs => $userAttributes);


Any help/advice would be greatly appreciated.
Thanks,
Frank

Replies are listed 'Best First'.
Re: LDAP Searches
by NetWallah (Canon) on Aug 22, 2011 at 23:52 UTC
Re: LDAP Searches
by Jim (Curate) on Aug 22, 2011 at 21:55 UTC

    By using the sizelimit option of the search method maybe?

    (I don't know. I don't use Net::LDAP. I just looked up the answer in the online documentation.)