I am trying to do the equivalent of this search:
ldapsearch -x -LLL -b "dc=ldaphost,dc=mydomain,dc=com" uid
Here is one of the many variations I tried:
use strict;
use Net::LDAP;
my $ldap=Net::LDAP->new("ldaphost.mydomain.com") or die "$@";
my $mesg=$ldap->bind();
if ($#ARGV<0) {
$mesg=$ldap->search(
base=>"dc=ldaphost,dc=mydomain,dc=com",
attrs=>["uid"]
);
print $mesg->entries(),"\n";
}
else {
}
$ldap->unbind();
I am just starting so my code is incomplete but it should be enough
to get something. However, I get nothing, not even an error. Can
someone see what I am doing wrong? TIA.