RE: Password modify

"Threet, Robert A" <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.ldap
Message-ID <[email protected]>
Yeah -  adds work great!  I didn't get how to modify the password.  It looks like you have to read in the entire entry - modify - then re-add it.  Noticed that thinking in the LDAP Admin Guide Friday night.


Robert Threet
Systems Manager
USI Computer Center
(812) 465-1070
Confidentiality Statement: This email message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and privileged information.

________________________________________
From: Chris Ridd [[email protected]]
Sent: Saturday, February 19, 2011 5:58 AM
To: Threet, Robert A
Cc: [email protected]
Subject: Re: Password modify

On 17 Feb 2011, at 17:10, Robert Threet wrote:

> I have a working Net::LDAP::Entry program for adding users so I decided
> to gut it to create a userPassword changer.
>
> I keep getting "Error changing password: no objectClass attribute".
>
> I cannot find examples doing simple one-at-a-time adds like this.  All I
> can find are examples using arrays and hashes and cannot seem to
> translate it to this.  Any tips?

There's a simple example right at the top of the Net::LDAP man page :-)

Or at <http://search.cpan.org/~gbarr/perl-ldap/lib/Net/LDAP.pod> if you prefer:

---
 $result = $ldap->add( 'cn=Barbara Jensen, o=University of Michigan, c=US',
                       attr => [
                         'cn'   => ['Barbara Jensen', 'Barbs Jensen'],
                         'sn'   => 'Jensen',
                         'mail' => '[email protected]',
                         'objectclass' => ['top', 'person',
                                           'organizationalPerson',
                                           'inetOrgPerson' ],
                       ]
                     );

 $result->code && warn "failed to add entry: ", $result->error ;
---

Chris
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.