Search Active Directory from Perl Using ADO

This is how to use ADO from Perl to search Active Directory. Once you learn how to search, you'll find that you'll use this technique over and over again in your scripts.

This example finds all users in the forest whose first name is Reginald.  To learn more about searching Active Directory, please see my more recent article Active Directory Enumeration and Search

use Win32::OLE;
$connection = Win32::OLE->new("ADODB.Connection");
$connection->{Provider} = "ADsDSOObject";
$connection->Open("ADSI Provider");
$command->{Properties}->{'Page Size'}=1000;
$rs = Win32::OLE->new("ADODB.RecordSet");
until ($rs->EOF){
 print "$displayName\n";


Post a Comment

Related Posts Plugin for WordPress, Blogger...