Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4566178
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T18:45:08+00:00 2026-05-21T18:45:08+00:00

When I do a search like so my $mesg = $ldap->search( base => OU=test,DC=example,DC=com,

  • 0

When I do a search like so

my $mesg = $ldap->search(
  base   => "OU=test,DC=example,DC=com",
  scope  => 'one',
  filter => '(objectClass=organizationalPerson)',
  attrs  => ['distinguishedName', 'displayName', 'sAMAccountName', 'employeeID'],
);

I only get 1000 entries, where I would expect ~20000.

Is it possible to increase this limit in my Perl script, or does it have to be changed on the server?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T18:45:09+00:00Added an answer on May 21, 2026 at 6:45 pm

    The solution is to use paged search like so

    use Net::LDAP;
    use Net::LDAP::Control::Paged;
    use Net::LDAP::Constant qw( LDAP_CONTROL_PAGED );
    
    my $page = Net::LDAP::Control::Paged->new(size => 999);
    my $cookie;
    
    while (1) {
        $mesg = $ldap->search(
        base    => "OU=test,DC=example,DC=com",
        scope   => 'one',
        filter  => '(objectClass=organizationalPerson)',
        attrs   => ['distinguishedName', 'displayName', 'sAMAccountName', 'employeeID'],
        control => [$page]
        );
    
        $mesg->code && die "Error on search: $@ : " . $mesg->error;
        while (my $adentry = $mesg->pop_entry()) {
    
        # process $adentry
        }
    
        my ($resp) = $mesg->control(LDAP_CONTROL_PAGED) or last;
        $cookie    = $resp->cookie or last;
        # Paging Control
        $page->cookie($cookie);
    }
    
    if ($cookie) {
        print "abnormal exit\n";
        # Abnormal exit, so let the server know we do not want any more
        $page->cookie($cookie);
        $page->size(0);
        $ldap->search(control => [$page]);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When I preform an LDAP search like so my $mesg = $ldap->search( base =>
which one should be used to manipulating data, Array or Array Object? Like search,sort
I am trying to implement a search like the one used on the app
I'd like to search for an upper case word, for example COPYRIGHT in a
I want to develop google desktop search like application, I want to know that
So GET forms make the usual urls like .../search/?q=apple Can you make a form
Are there any gems that would help me make a search box like the
is there any easy way in the iPhone SDK to include search bars like
I'd like to search for a given MAC address on my network, all from
I'd like to search a Word 2007 file (.docx) for a text string, e.g.,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.