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 > FW: ldapsearch ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 6 Topic 1014 of 1056
Post > Topic >>

FW: ldapsearch equivalent with Net::LDAP

by jeremiah.foster@[EMAIL PROTECTED] (Jeremiah Foster) Nov 27, 2007 at 09:20 AM

=20

-----Original Message-----
From: Jeremiah Foster=20
Sent: den 27 november 2007 09:20
To: 'Dennis Putnam'
Subject: RE: ldapsearch equivalent with Net::LDAP

=20
=20
> I am trying to do the equivalent of this search:
>=20
>      ldapsearch -x -LLL -b "dc=3Dldaphost,dc=3Dmydomain,dc=3Dcom" uid

Caveat Emptor: I am no LDAP genius.
=20
> Here is one of the many variations I tried:
>=20
>      use strict;
>      use Net::LDAP;
>=20
>      my $ldap=3DNet::LDAP->new("ldaphost.mydomain.com") or die "$@[EMAIL PROTECTED]
";

Try replacing $@[EMAIL PROTECTED]
 with $!. You are using $@[EMAIL PROTECTED]
 which is the eval error
message, but I don't see where you are using eval. $! will tell you what
went wrong since it is the sys/libcall error message.=20

>      my $mesg=3D$ldap->bind();
>=20
>      if ($#ARGV<0) {
>              $mesg=3D$ldap->search(
>                      base=3D>"dc=3Dldaphost,dc=3Dmydomain,dc=3Dcom",
>                      attrs=3D>["uid"]
>              );
>      print $mesg->entries(),"\n";
>      }
>      else {
>      }
>      $ldap->unbind();
>=20
>=20
> 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=20
> see what I am doing wrong? TIA.

See what your code spits out now and diagnose from there. Hopefully that
is a start.

	Jeremiah
 




 6 Posts in Topic:
FW: ldapsearch equivalent with Net::LDAP
jeremiah.foster@[EMAIL PR  2007-11-27 09:20:03 
Re: ldapsearch equivalent with Net::LDAP
dennis.putnam@[EMAIL PROT  2007-11-27 07:15:37 
Re: ldapsearch equivalent with Net::LDAP
dennis.putnam@[EMAIL PROT  2007-11-27 07:42:00 
Re: ldapsearch equivalent with Net::LDAP
dennis.putnam@[EMAIL PROT  2007-11-27 08:55:35 
Re: ldapsearch equivalent with Net::LDAP
shellys@[EMAIL PROTECTED]  2007-11-27 09:29:19 
Re: ldapsearch equivalent with Net::LDAP
phreelance@[EMAIL PROTECT  2007-11-27 20:22:29 

Post A Reply:
  Go here to Signup

AddThis Feed Button


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

Contact
tan12V112 Thu Jul 24 0:54:31 CDT 2008.