Rick,
 
I've script that do the same, but with Win32::Lanman. For a long time I don't use more Win32::AdminMisc, it's to much unstable on my enviroment and got many problem, because this I moved all codes to Win32::Lanman.
 
Try the code below.
 
Solli
 
<code>
    if ( Win32::Lanman::NetUserSetProp( "\\\\$Computer", $UserName, { 'password'=> "$Password" } ) )
    {
        my %UserInfo;
        if( Win32::Lanman::NetUserGetInfo ($Computer, $UserName, \%UserInfo))
        {
             # Save the information about the password changed.
        }
    }
    else
    {
        #Get message error and to anythink
        $MailMessage .= "Erro : " . Win32::Lanman::GetLastError() . " na tentativa de alterar a senha no servidor $Computer";
    }
</code>
> Hi Folks-
>
> I'm trying to change the administrator password on around 2200
> windows machines. I have a script that generates random passwords,
> records the random password & machine name, and then tries to use
> adminmisc to change the password on the client machine:
>
>
> $machine="thor";
> $user="administrator";
> $password="r4nd0m";
> #Change the password
> $Result = Win32::AdminMisc::SetPassword($machine, $user, $password);
>
>
>
> This looks and feels right, and even runs.
>
> According to the roth site, a $Result of 1 is "it worked" and a
> $Result of 0 is bad news.
>
> I ALWAYS get a result of 1.... And it never works.
> http://www.roth.net/perl/adminmisc/#SetPassword
>
> Any ideas or suggestions?
>
> I've tried to run this from both server 2000 and xp against primarily
> xp clients, but also against some 2000 servers and 2000 pro laptops,
> using perl 5.6.1 with adminmisc version 20000117 because any version
> newer (of adminmisc) doesn't work properly with groups. I've seen
> lots of references to that issue on the web.
>
> Thanks in advance!
>
> -Rick
>
>
>
> --
> Rick Coloccia
> Network Manager
> SUNY Geneseo Computing & Information Technology
> 119 South Hall, 1 College Circle, Geneseo, NY 14454
> Voice: 585-245-5577 Fax: 585-245-5579
>
> _______________________________________________
> Perl-Win32-Admin mailing list
> Perl-Win32-Admin@listserv.ActiveState.com
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
_______________________________________________
Perl-Win32-Admin mailing list
Perl-Win32-Admin@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to