in reply to Change Password on AD via Perl/LDAPS/Convert::BER
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..
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.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); }
Hope this helps,
Rich
|
|---|