Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Using Perl, how to return more than 1000 results from LDAP search?

Posted on 2011-03-25
4
Medium Priority
?
416 Views
Last Modified: 2012-05-11
Hello,

I have a perl script that uses Net::LDAP to query AD. It works correctly, but I can't get more than 1000 results back. I see that there are solutions posted for VBscript but how about perl? I've seen about Net::LDAP::Control::Paged, and I'm able to bring back the amount I specify up to 1000. Does anyone have an example of looping through and getting all records?

Thanks for any help!
0
Comment
Question by:USSteel
4 Comments
 
LVL 26

Accepted Solution

by:
MidnightOne earned 500 total points
ID: 35226423
According to the Net::LDAP docs, the search parameter sizelimit => N should return all results, but it also says the queried server may limit it anyway.

Try adding this to the search parameters to see if it makes any difference.
0
 

Author Comment

by:USSteel
ID: 35235401
Your comment was correct, thank you. Though, it turns out I had a mistake in not including

use Net::LDAP::Constant qw( LDAP_CONTROL_PAGED );

After I added that line, it pages completely through correctly. I didn't realize that line was necessary.

Thanks for your help.
0
 
LVL 9

Expert Comment

by:Suhas .
ID: 37319332
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

Simplify Active Directory Administration

Administration of Active Directory does not have to be hard.  Too often what should be a simple task is made more difficult than it needs to be.The solution?  Hyena from SystemTools Software.  With ease-of-use as well as powerful importing and bulk updating capabilities.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Group policies can be applied selectively to specific devices with the help of groups. Utilising this, it is possible to phase-in group policies, over a period of time, by randomly adding non-members user or computers at a set interval, to a group f…
Compliance and data security require steps be taken to prevent unauthorized users from copying data.  Here's one method to prevent data theft via USB drives (and writable optical media).
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…

971 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question