Discreet Entity has asked for the wisdom of the Perl Monks concerning the following question:

Folks:

I have used the Net::LDAP module lots of timees to do searches. However, I cannot seem to figure out how to get the attributes for a specific user when I already have the distinguished name.

For instance, I have a string like so:

"CN=JUSER,OU=ACCT,OU=USERS,DC=MYCOMPANY,DC=COM"

I just need to connect to that specific user object and get the properties. I have read all the help on Net::LDAP and searched but every example seems to be about doing a search and I don't need to search since I already have the dn.

I can do this easily in vbscript by just setting the object to the dn. Surely I can do something similar in perl.

Please help explain what I'm missing.

Thanks,

Replies are listed 'Best First'.
Re: Net::LDAP help with distinguished name
by NetWallah (Canon) on Feb 03, 2012 at 22:13 UTC
    This old node may help - it has code on how to do this search, and display on a web page.

                “PHP is a minor evil perpetrated and created by incompetent amateurs, whereas Perl is a great and insidious evil perpetrated by skilled but perverted professionals.”
            ― Jon Ribbens

      Sorry that doesn't help. That's a search which is specifically what I don't need. I just need to connect to the object using the distinguished name.

      I can't believe this is hard. It's so basic. I must be missing something.

      Anyone??

        I can't believe this is hard. It's so basic. I must be missing something.

        Yes, password is used all over the documentation