Hi.
I'm having trouble running a complex query against our company LDAP server. I'm using the following Perl script:
use Data::Dumper;
use Net::LDAP;
die "Can't connect to LDAP-Server: $@\n"
unless $ldap = Net::LDAP->new( 'xLDAPx' );
foreach my $filter ( 'ou=Personal', 'ou=BAR', 'ou=Personal,ou=BAR', 'ou=Personal,ou=FOO,o=FOO,dc=foo,dc=com' )
{
$mesg = $ldap->search( base => "o=FOO,dc=foo,dc=com", filter => $filter );
print Dumper($mesg), "\n\n";
}
While the first two filters work (as in returning the expected values) the last and complex one doesn't. It returns an empty array. What really puzzles me is that exactly the same query string works when I use it with a tool like the Softerra LDAP Browser.
I have also tried the same query using PHP's ldap_search
& co, no avail.
Can somebody shed some light on this?
Thanks for reading
holli
Edit: This is the structure of the server:
Server
ou=FOO
ou=...
ou=Personal
uid=something
I need a list of uids.