nslookup -type=srv _ldap._tcp.domain nslookup -type=srv _ldap._tcp.domain.tld (?) #### #!/usr/bin/perl use strict; use warnings; use Net::LDAP; my $ldap_server = "svlitdc1.shoretel.com"; my $ldap = Net::LDAP->new($ldap_server) or die "$@"; my $mesg = $ldap->bind ('', password => '', version => 3) or die "FATAL ERROR: LDAP bind did not succeed: $!\n"; my $username = "tienle"; $mesg = $ldap->search (base => "c=US", filter => "(&(sn=" . $username . ")(o=ShoreTel))"); $mesg->code && die $mesg->error; foreach my $entry ($mesg->entries) { $entry->dump; } $mesg = $ldap->unbind; print "Done!\n"; #### 000004DC: LdapErr: DSID-0C0906E8, comment: In order to perform this operation a successful bind must be completed on the connection., data 0, v1db1 at ./ldap_try1.pl line 12, line 751.