N
Nex6
Hello all:
Ok, This is what I am trying to do:
I have a group of machines of maybe 200 workstations running NT 4.0
workstation. They are on Policy.
I want to push out some changes but the changes MUST happen in a
controlled and safe way. as these are production machines.
the gist of it is like this,
connect to machine1
make changes to reset.reg
make changes to registry
make change to domain account that matches machine.
connect to machine2
make changes to reset.reg
make changes to registry
make change to domain account that matches machine.
etc etc etc.....
I will be running this from a windows 2000 pro machnie running active
state perl.
so this is what I am thinking, have perl, pull the machine name from a
text file and use that as a $var to pass it to open and the other
statements and wrap the whole thing in a for or for each loop.
I am having some trouble get it to work , i am working on the text pull
now so any help would really be great!!!
/code:
open loc, "<testpull.txt";
#my $file = '+<\\\\dsmccsb264da\\c$\\reset.reg';
$file = <loc>;
#$file = '+<\\\\dsmccsb264da\\c$\\reset.reg';
$oldpass = '"password"'; #put old password here
$newpass = '"newpass"'; #put NEW password here
#print $file;
open fh, '+<\\\\$file\\c$\\reset.reg' or die "can't open $file: $!";
$slurp = join '', <fh>;
$slurp =~ s/$oldpass/$newpass/ig;
seek(fh,0,0);
print fh $slurp;
truncate(fh,tell(fh));
close(fh);
close(loc);
/end code:
This is what i have so far,
when everything is staticd in it works, but now I need to pull just the
machine name and use it becuase later i will need to use the same var to
make the domain controller change.
where it seem to have issues is connecting to the file , perl seems to
be have trouble with the $file and pass it and such.
Thanks!!!!
-Nex6
Ok, This is what I am trying to do:
I have a group of machines of maybe 200 workstations running NT 4.0
workstation. They are on Policy.
I want to push out some changes but the changes MUST happen in a
controlled and safe way. as these are production machines.
the gist of it is like this,
connect to machine1
make changes to reset.reg
make changes to registry
make change to domain account that matches machine.
connect to machine2
make changes to reset.reg
make changes to registry
make change to domain account that matches machine.
etc etc etc.....
I will be running this from a windows 2000 pro machnie running active
state perl.
so this is what I am thinking, have perl, pull the machine name from a
text file and use that as a $var to pass it to open and the other
statements and wrap the whole thing in a for or for each loop.
I am having some trouble get it to work , i am working on the text pull
now so any help would really be great!!!
/code:
open loc, "<testpull.txt";
#my $file = '+<\\\\dsmccsb264da\\c$\\reset.reg';
$file = <loc>;
#$file = '+<\\\\dsmccsb264da\\c$\\reset.reg';
$oldpass = '"password"'; #put old password here
$newpass = '"newpass"'; #put NEW password here
#print $file;
open fh, '+<\\\\$file\\c$\\reset.reg' or die "can't open $file: $!";
$slurp = join '', <fh>;
$slurp =~ s/$oldpass/$newpass/ig;
seek(fh,0,0);
print fh $slurp;
truncate(fh,tell(fh));
close(fh);
close(loc);
/end code:
This is what i have so far,
when everything is staticd in it works, but now I need to pull just the
machine name and use it becuase later i will need to use the same var to
make the domain controller change.
where it seem to have issues is connecting to the file , perl seems to
be have trouble with the $file and pass it and such.
Thanks!!!!
-Nex6