I ran into a simmilar problem with workstations. I kind of cheated in that I used CRYPTPWD.exe ( Someone from this bulliten had shared this utility with me... if you run from command line you can view it's other options.. don't know if it's in the resource kit or not...) and wrapped it in a perl file.
I created separate files of the computers I wanted changed so that I had some more control and then passed this file to the script.
I am not sure how something like this will work if trying to change the username/permissions/password...
AS WITH ANY CODE CONCERNING SERVERS AND PASSWORDS... I WOULD TEST THE HECK OUT OF IT BEFORE TURNING IT LOOSE.
Sample code:
##### OPEN LOG FILE
if ($ARGV[0] eq "")
{
die ("NO FILENAME PASSED!\n");
}
##### Open File containing machines to have admin passwrd changed on
open (COMPLIST, "$ARGV[0]") || die ("CAN'T OPEN $ARGV[0]\n");
##### OPEN output FILE
open (OUTPUT, ">adminlog.log") || die ("CAN'T OPEN adminlog.log");
##### MAIN
# declare vars
@filelist=<COMPLIST>;
$part = " ";
foreach $listitem (@filelist)
{
$part = "cryptpwd.exe -u administrator -m $listitem -P NEWPASSWORD";
system $part;
print (OUTPUT "$part\n");
}
-John
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 02, 2001 10:35 AM
To: [EMAIL PROTECTED]
Subject: Mass change of local passwords
I recently inherited a network of several hundred NT servers, spread
throughout the country, all of which have different passwords for the local
administrator account. The username for that account is the same across the
board. Not all the passwords are known. I'd like to change both the username
and password for the local administrator account on all of these servers
(one fell swoop), so they match a new standard. One server at a time would
take too long. I figure the only way to do this is via a script; possibly
providing my domain admin credentials to access the SAM. As a newbie to
Perl, I'm getting no where fast. Can somebody lend assistance? Almost all of
the servers have ActivePerl 5.5 installed.
P.S. - I've barely started to learn to use modules.
Brett Baumer
Levi Strauss & Co.
Sr. LAN Analyst
Global Data Center Operations
Phone: (415) 501-5408
Pager: (888) 423-1763
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-admin
