[Samba] AD passwd change

Andrew Morgan morgan at orst.edu
Mon Jan 8 18:30:48 GMT 2007


On Sun, 7 Jan 2007, Azher Amin wrote:

> Hi,
>
> Can someone guide me, how to change the password of windows AD using a linux 
> script.

Here is a snippet of perl code we use to change AD passwords:

   my $unicodepwd = pack("v*", (unpack("C*", "\"$newpw1\"")));
   $mesg = $ad->modify($addn, replace => { unicodepwd => $unicodepwd });

Where $newpw1 is the new password, and $ad is a Net::LDAPS object 
connected to an AD domain controller as a user with privileges to update 
passwords.

 	Andy


More information about the samba mailing list