Hi,

 

I'm trying to programmatically change a local password on several Computers,
but the Win32API::Net and Win32::NetAdmin modules seem not to be appropriate
for that.

Wondering whether there's any Win32 API module for that. I tried using the
UserChangePassword function, and wasn't surprise it didn't work.

 

 

use diagnostics;

use Net::Ping;

use Win32API::Net qw(:User);

use strict;

 

my $host = 'localhost';

 

my $obj = Net::Ping->new("icmp");

 

print "\nTrying to ping $host\n..........\n";

 

if ($obj->ping($host, 2)){

            print "Ping successful....\n";

            

            if (UserChangePassword("$host", 'user', 'oldpasswd ',
'ChangedNow')){

 

                        print "Work ok\n";

            

            }else { print "Failed: $^E\n";}

            

}else {

            print "Could not ping....\n";

}

 

$obj->close();

 

#################################

 

Any suggestion.......?

 

Thanks 

Babs

 

Reply via email to