我一直在尝试打印出“域用户”中的所有成员。问题是,它只打印出其中的一小部分,然后就停止了。不确定原因。有人能解决这个问题吗?
#!/usr/bin/perl
use Net::LDAP;
my $uid = "cn=account,cn=users,dc=domain,dc=local";
my $bindPass = "password";
my $ldapServer = "ldap://server.domain.local";
# connect to ldap server
$ldap = Net::LDAP -> new ($ldapServer) || die "Could not connect to server\n";
# bind to ldap server
$ldap -> bind($uid, password => $bindPass);
# search for group
$mesg = $ldap -> search(filter => "(&(cn=Domain Users))", base => "dc=domain,dc=local");
$entry = $mesg -> entry;
# @members = $entry -> get_value ('member;Range=0-*');
#the above entry when uncommented doesn't work either.
@members = $entry -> get_value ('member');
foreach $thing (@members) {
print "$thing\n";
}