Re: LDAP Search for all attributes of a DN

Dieter Kluenter <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.ldap
Organization AVCI
Message-ID <[email protected]>
Am Fri, 4 Mar 2011 13:38:56 -0500
schrieb Brian Gaber <[email protected]>:

> I have tried these two Net::LDAP approaches, but $numEnt is zero in
> both cases:
> 
> $mesg = $ldap->search( base => $dn );
> $numEnt = $mesg->count;

you should add a scope, IFAIK default is base, so scope onelevel or
subtree would present the intended results.
 
> $mesg = $ldap->search ( base => $dn, scope => 'base',);
> $numEnt = $mesg->count;

scope base only returns the baseDN

> A command line ldapsearch like so works fine:
> 
> ldapsearch -h my_ldap_server -x -b "fully qualfied dn"

If this is OpenLDAP ldapsearch, the default scope is onelevel

-Dieter

-- 
Dieter Klünter | Systemberatung
http://dkluenter.de
GPG Key ID:DA147B05
53°37'09,95"N
10°08'02,42"E
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.