If you find an easier method than what I'm about to give, I'd sure like to
know it. I jump through hoops to actually do this on an NT network.

First, if the procedure can be run pointed to a remote box (like "at" or
"shutdown") it's easy to do:

examples:

$schedule = `at \\server01 03:00 dothis.bat`;

#use backticks to drop execution through to the shell


Or, if I have SQL installed on the remote box (Which I usually do) I'll use
the DBI module, make a connection to the remote SQL server, and use
something like:

$dbh->do(qq{EXEC master..xp_cmdshell 'dothis.bat'});

When nothing else works, I run a net time to determine the time on the
remote box:

$rtime = `net time \\remotebox`;

Then take that input, and process it to schedule startup on the remote box
two minutes later. (note that the datecalc module makes this much easier)
using the AT command similar to what I did above.


None of those are pretty examples, but they are things I do because I have
yet to find a pretty way to start execution on a remote box. However, let me
know if you find something....it'll make my life a lot easier as well.

Steve Howard

-----Original Message-----
From: Michael Dube [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 12, 2001 11:19 AM
To: Perl Beginners List
Subject: Remote command execution on NT and Solaris?


I have just begun a project that will involve automated state setting on
multiple machines across multiple platforms (NT & Solaris).  At this point I
believe this will be done by writing scripts for each platform and having a
centralized system (NT or Solaris) execute a script which will instruct each
of the other systems to run their initialization script.

Is there a PERL module available which will facilitate remote command
execution for NT and Solaris?

Any suggestions on the best way to do this?

Thanks,

Mike

Reply via email to