This should give you a
start. I’m not doing anything crazy here, just using Win32::Lanman to
add the users. use strict; use warnings; use
Win32::Lanman; my $server =
'computer'; my $userFile =
'users.txt'; my %users; print
"Importing users from $userFile..."; open(INFILE,"<$userFile")
or die("Couldn't open '$userFile' for reading!\n"); while(my $line =
<INFILE>){ chomp
$line; my
($user,$fullname,$pass,$comment) = split(':',$line); $users{$user}
= [$fullname,$pass,$comment]; } print
"done.\n\n"; print
"Importing users...\n\n"; foreach my
$newUser(sort keys %users){ print
"\t$newUser..."; my
($fullname,$pass,$comment) = @{$users{$newUser}}; my %properties
= (name => $newUser,
full_name => $fullname,
comment => $comment,
password => $pass); if(Win32::Lanman::NetUserAdd("\\\\$server",\%properties)){ print
"success!\n"; }else{ print
"FAILED!\n"; } } From:
[EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Eddie Willett Anyone have a good way to add local users to workstations
quickly? Eddie
|
_______________________________________________ Perl-Win32-Admin mailing list Perl-Win32-Admin@listserv.ActiveState.com To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs