jedg has asked for the wisdom of the Perl Monks concerning the following question:
Here is the code I am using: Thanks for any suggestions/help you could provide.failed: 19 0000216C: AtrErr: DSID-031D0A99, #1: 0: 0000216C: DSID-031D0A99, problem 1005 (CONSTRAINT_ATT_TYPE) +, data 0, Att 9005a (unicodePwd) at password.pl line 50
#!/umr/testbin/perl $| =1; use Convert::BER; use Net::LDAPS; $ldaps = new Net::LDAPS('srvtst01.cc.umr.edu', port=> '636'); $UserPass="*******"; $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\"", # STRING=>"\x00\"\x00h\x00e\x00l\x00l\x00o\x00\"", ) or die; $pw = $pwd->buffer; $mesg = $ldaps->modify(dn => $tempDN, changes => [ replace => [ unicodePwd => '$pw' ] ] ); $mesg->code && die "failed: ", $mesg->code," ",$mesg->error;
2001-04-06 Edit by Corion : Removed plaintext password, added CODE tags to error message.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Change Password on AD via Perl/LDAPS/Convert::BER
by araqnid (Beadle) on Apr 06, 2001 at 04:30 UTC | |
|
Re: Change Password on AD via Perl/LDAPS/Convert::BER
by rchiav (Deacon) on Apr 06, 2001 at 20:35 UTC |