From: Chris R. <chr...@me...> - 2002-01-16 18:02:27
|
CZa...@wi... wrote: > Hello how do I obtain this info "CN=John Doe,OU=IT,OU=NewYork,O=XYZ" using > the example below ? > I would figure that $mesg would return this information back from the > search. I have tried numerous examples and I'm still unable to display > the results. > > Please help. > > Thank you. > > > > $ldap->bind ; > > $mesg = $ldap->search( > base => 'o=wiley', > scope=> 'subtree', > filter=> "(&(objectclass = interorgperson) (mail = $username))" > ); > > $mesg->code && die $mesg->error; > > > foreach $entry ($mesg->entries) { $result = $entry->dn; print > "$result\n"; } > > $ldap->unbind; > > Why do you expect a search under <o=wiley> to return entries under <o=xyz> (eg the cn=John Doe entry)? Unless <o=wiley> is an alias, these are disjoint subtrees, and since you haven't told the search method to follow any aliases under <o=wiley> you are never going to get results with a DN ending in <o=xyz>. If you are using aliases, then check the 'deref' argument to search. If you think the data is coming back to your program but you're not able to retrieve it from the Net::LDAP objects correctly, try setting debug => 12 when creating the $ldap object and see if that reveals any results coming back. You may need to explain a bit more about the structure of your DIT before anyone can provide more concrete help :-) Cheers, Chris |