Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Mac > Perl on OSX > ldapsearch equi...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 1013 of 1076
Post > Topic >>

ldapsearch equivalent with Net::LDAP

by dennis.putnam@[EMAIL PROTECTED] (Dennis Putnam) Nov 26, 2007 at 12:12 PM

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 "$@[EMAIL PROTECTED]
";
     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.
 




 1 Posts in Topic:
ldapsearch equivalent with Net::LDAP
dennis.putnam@[EMAIL PROT  2007-11-26 12:12:35 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Dec 5 0:22:00 CST 2008.