|
ADSI::Perl::
use File::Basename;
use Win32::OLE;
use Win32::OLE qw( in );
$prog = basename(replacebegin:content:replaceend);
if($#ARGV < 0)
{
die "\nUsage: $prog \n";
}
$ldap_path = $ARGV[0];
print "$ldap_path\n";
#eg. $prog "LDAP://CN=Master of Engineering,ou=Postgrad,ou=Distribution List,dc=student,dc=main,dc=somecollege,dc=edu";
$oContainer = Win32::OLE->GetObject($ldap_path);
$oContainer->{Filter} = ["user"];
$oMembers = $oContainer->{'Members'};
foreach $oMember (in $oMembers)
{
$cn = $oMember->{'Name'};
$displayname = $oMember->{'DisplayName'};
print $displayname . "\n";
}
|
|