Perl – How to search by dn in ldap


I'm pulling information about a user from ldap. This includes directReports, which is in the full "CN=cnBlah, OU=ouBlah, DC=dcBlah" form. I'm trying to do another lookup to find info about the reportee.

So far the only way I've been able to actually find said user is to break out the CN= and set the remainder of the string as the base.

Is this the proper way of doing it? Or is there a way to search for an entry given the full dn?

Best Solution

Use the DN as the base object in the search and set the scope of the search to base.

Related Question