I am trying to get this to print all members in "domain users". The problem is that it only displays a small part of them, and then just sorted. I do not know why. Can someone shed light on the problem?
use Net::LDAP;
my $uid = "cn=account,cn=users,dc=domain,dc=local";
my $bindPass = "password";
my $ldapServer = "ldap://server.domain.local";
$ldap = Net::LDAP -> new ($ldapServer) || die "Could not connect to server\n";
$ldap -> bind($uid, password => $bindPass);
$mesg = $ldap -> search(filter => "(&(cn=Domain Users))", base => "dc=domain,dc=local");
$entry = $mesg -> entry;
@members = $entry -> get_value ('member');
foreach $thing (@members) {
print "$thing\n";
}
source
share