in reply to Re: Win32::OLE Password Change?
in thread Win32::OLE Password Change?
In case anyone reads this in the future and would like my resolution, here it is:
...and this works as long as the authenticated user has administrative rights. I'd still be interested in knowing if anyone has a WMI solution for this as well, but I am very happy using ADSI. Thanks again!!!$winntobj = Win32::OLE->GetObject('WinNT:') or croak( 'Cannot create WINNT object - ', $! ); if ($debug) { print "Attempting bind to WINNT on $server for authenticating $use +r/$password...\n"; } $userobj = $winntobj->OpenDSObject( "WinNT://$server/$pworduser,User", $user, $password, 1 ); my $err = Win32::OLE->LastError(); if ($err == 0) { print STDOUT "Successful authentication!\n"; else { print STDOUT $err; } $userobj->SetPassword($newpassword);
|
|---|