From: Edgington, J. <je...@um...> - 2001-04-02 19:59:39
|
Good point :) This is the error I am getting back. failed: Net::LDAP::Modify=HASH(0x8490370)->error at password.pl line 38. -----Original Message----- From: Graham Barr [mailto:gb...@po...] Sent: Monday, April 02, 2001 2:58 PM To: Edgington, Jeffrey Cc: per...@li... Subject: Re: Changing password via Net::LDAPS and Perl It would probably help others help you if you could tell us how it is failing to do what you expect. Graham. On Mon, Apr 02, 2001 at 02:48:14PM -0500, Edgington, Jeffrey wrote: > Ok... I'm hoping someone has already done this and can tell me what I have > wrong... I want to reset passwords via Net::LDAPS (LDAP over SSL) but having > little luck with it. > > Below is the code as it stands now.... thanks for any help you can give me. > > > #!/umr/testbin/perl > > $| =1; > > use Convert::BER; > use Net::LDAPS; > > $ldaps = new Net::LDAPS('srvtst01.cc.umr.edu', > port=> '636'); > > > $UserPass="94ranger"; > $UserID="Administrator"; > $ADSserver='srvtst01.cc.umr.edu'; > $DomainDN=" dc=test, dc=umr, dc=edu"; > $UserDN="cn=$UserID, cn=users, " . $DomainDN; > > $ldaps = Net::LDAPS->new($ADSserver) || die "failed: $@"; > > $mesg = $ldaps->bind( dn =>"$UserDN", password => "$UserPass" ); > $mesg->code && die "bind failed: $mesg->error"; > > $tempDN = "cn=Test2 Edg, cn=Users, " . $DomainDN; > > > $pwd = new Convert::BER; > > $pwd->encode( > STRING=>"hello", > ) or die; > > $mesg = $ldaps->modify(dn => $tempDN, > changes => [ > replace => [ unicodePwd => "$pwd"] > ] > ); > > $mesg->code && die "failed: $mesg->error"; > > > > > > > > > |