Janitor's note: Was entitled "Write down these almost dead tired me, but I am ready to see answer to death;I have a question abort "perl ldap _search""

My English is very poor,so I'm sorry first!~If you can see I've been very thank 。 after AD server upgrade to Windows Server 2008,One of my perl script encountered a problem. error is :"Net::LDAP::Search=HASH(0xf47e00)" In a other “OU”or change scope => 'one' or 'base' ,Error will disappeared (OU is not wrong.) thanks first

# LDAP server my $LDAP_BASE = 'OU=Aaa,DC=internal,DC=aaa,DC=com'; # LDAP search ba +se my $LDAP_SERVER = 'xxx-yyy.zzz.aaa.com'; my $LDAP_DN = 'readonly'; my $LDAP_PASSWORD = 'passwd'; my $filter = "(&(objectClass=person))"; # connect to LDAP server my $ldap = Net::LDAP->new($LDAP_SERVER, onerror => \&sendMail); if (!defined($ldap)) { &sendMail("Failed to connect to LDAP Server [$LDAP_SERVER]"); } # bind account my $result = $ldap->bind($LDAP_DN, password => $LDAP_PASSWORD); if ($result->code()) { &sendMail("AD bind failed"); } # get account information $result = $ldap->search( base => $LDAP_BASE, scope => 'sub', # entire tree timelimit => 600, filter => $filter, attrs => ['sAMAccountName','mail'], );

In reply to Problem with LDAP query by yuliu1212

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.