Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

RE: RE: setting remote registry values

by why (Acolyte)
on Sep 22, 2000 at 22:46 UTC ( [id://33678]=note: print w/replies, xml ) Need Help??


in reply to RE: setting remote registry values
in thread setting remote registry values

Actually, Perl is often perfect for this. The Policy Editor is good for forcing changes that your users keep undoing (something I don't have a need for and hate when I see others do it). But I find lots of uses for remote registry changes. For example, using VNC (a free "PC Anywhere" tool), batch updates of passwords on dozens of servers would be a pain or unworkable using either of your suggestions.

my $Reg; use Win32::TieRegistry( TiedRef => \$Reg, Delimiter => "/", ArrayValues => 1 ); for my $mach ( @ARGV ) { my $remReg= $Reg->{"//$mach/LMachine/"} or do { warn "Can't access ${mach}'s registry: $^E\n"; next; } my $linux= $remReg->{"Software/Slackware/Linux/CurrentVersion/ +"} or die "Can't read ${mach}'s SW/SW/Linux/: $^E\n"; $linux->{"Passwords//root"}= "guessme" or die "Can't modify ${mach}'s root password: $^E\n"; }

(Note that the above code is just "silly" in that you can't install Linux as an application under Win32 and even if you did you probably wouldn't set the passwords as plain-text in the registry.)

I actually have a script that lets you define a remote installation file describing what file to copy to the remote machine and what changes to make to the registry. You can use it to install software locally (it was used to automate installation of third-party software on machines we sold) or to install something on a whole list of remote machines in one step. Existing tools were not up to this task because the registry changes are not uniform and most "sysdiff"-like tools have no or very limited ability to make the changes context sensitive.

For the original poster, it is usually much better to give us the example code that you tried and couldn't get to work along with complete details about how it doesn't work. Asking vague questions and asking for examples usually doesn't get you as many answers nor nearly as good of answers.

Replies are listed 'Best First'.
RE: RE: RE: setting remote registry values
by Adam (Vicar) on Sep 22, 2000 at 22:47 UTC
    You beat me to it. I was just about to post my suggestion to use Win32::TieRegistry, which, by the way, was written by a Perl Monk.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://33678]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (4)
As of 2024-04-19 04:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found