in reply to Re^3: what is a pure perl equivalent for "net user username /domain"?
in thread what is a pure perl equivalent for "net user username /domain"?
I'm getting a failure to bind, either of the anonymous or non-anonymous kind. Perhaps I chose the wrong LDAP server. I guessed what it was on the basis of a Google search where the suggestion was to do an nslookup.
nslookup -type=srv _ldap._tcp.domain nslookup -type=srv _ldap._tcp.domain.tld (?)
I got many replies, I chose one that sounded (phonetically) like it looked geographically compatible with my location in my domain.
There's no error at the time of bind but the bind error occurs when I try to execute the search.
script:
#!/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 "FATA +L ERROR: LDAP bind did not succeed: $!\n"; my $username = "tienle"; $mesg = $ldap->search (base => "c=US", filter => "(&(sn=" . $usernam +e . ")(o=ShoreTel))"); $mesg->code && die $mesg->error; foreach my $entry ($mesg->entries) { $entry->dump; } $mesg = $ldap->unbind; print "Done!\n";
Results:
Thanks, Ken000004DC: LdapErr: DSID-0C0906E8, comment: In order to perform this op +eration a successful bind must be completed on the connection., data +0, v1db1 at ./ldap_try1.pl line 12, <DATA> line 751.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: what is a pure perl equivalent for "net user username /domain"?
by Discipulus (Canon) on May 24, 2016 at 09:19 UTC | |
|
Re^5: what is a pure perl equivalent for "net user username /domain"?
by MidLifeXis (Monsignor) on May 24, 2016 at 16:35 UTC | |
by kwolcott (Acolyte) on May 24, 2016 at 17:40 UTC |