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:

000004DC: 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.
Thanks, Ken

In reply to Re^4: what is a pure perl equivalent for "net user username /domain"? by kwolcott
in thread what is a pure perl equivalent for "net user username /domain"? by kwolcott

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.