From: Colin B. <bla...@bi...> - 2001-05-04 21:38:10
|
Hi there As per the subject I am attempting to perform searches using the 'search' method as per the code below: #!/usr/bin/perl use strict; use Net::LDAP; my $ldap; my $mesg; my $mbname = 'bill'; my $domain = 'projectshps.com'; my $ldapSearch; my $ldapEntry; $ldap = Net::LDAP->new('localhost'); $mesg = $ldap->bind( 'cn=Manager, dc=mydomain, dc=com', password => 'mypassword'); $ldapSearch = $ldap->search([ base => 'dc=mydomain,dc=com', filter => 'cn=*', attrs => [], scope => 'sub', ]); print $ldapSearch->count . "\n"; foreach $ldapEntry ($ldapSearch->entries){ print $ldapEntry->get('cn'); } $mesg = $ldap->unbind(); This is producing one line of output, namely a 0 to indicate no results. However when I type in the shell command: ldapsearch -D 'cn=Manager, dc=mydomain, dc=com' -w 'mypassword' -b 'dc=mydomain, dc=com' cn=* this produces the pages of results I would expect. I'm not sure what version of the package I have - it was there when I found it. I have had success with the other methods though, ie add, delete, modify Please help Colin |