I am having NO luck doing this... I'm hoping to find someone who has SUCCESSFULLY done this. I get the following error when I try:
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
Here is the code I am using: Thanks for any suggestions/help you could provide.
#!/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.


In reply to Change Password on AD via Perl/LDAPS/Convert::BER by jedg

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.