From: Edgington, J. <je...@um...> - 2001-04-02 19:48:22
|
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"; |