(After I posted this I kinda realized that you're not running this on a windows box so it's completely usless. I'll leave it for people wondering how to do this on Wintel machines though)

Uhmm.. I don't have an answer for your method of doing this, but I thought I'd offer an easier way to change passwords in AD.. as long as you have ADSI installed..

use strict; use WIN32; use Win32::OLE; my $domain = Win32::DomainName(); chomp (my $user = shift @ARGV); chomp(my $new_pw = shift @ARGV); if (my $objUser = Win32::OLE->GetObject("WinNT://$domain/$user,user")) + { $objUser->SetPassword($new_pw); }
and that's it. It takes the username and new pwd as input. Obviously this hasn't been idiot proofed at all.. but it shows you the functionality of ADSI. But then again, you may have different reasons for not doing it this way.

Hope this helps,
Rich


In reply to Re: Change Password on AD via Perl/LDAPS/Convert::BER by rchiav
in thread 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.