Previous Topic: Using the run-local CommandNext Topic: Using the RemoteTarget Class


Using the run-remote Command

The run-remote command executes expressions or script files on one or more remote AutoShell client systems. For remote execution to work, the remote target node must have the AutoShell client installed and be configured.

The run-remote command supports specifying expressions, scripts and arguments in the same way as the run-local command. Script files must reside on the manager system and transfer to the target systems for execution. In addition, specify the remote clients with the on clause. Specifying a server name is the simplest way of invoking the run-remote command:

run-remote "1+2" on "ascl1"

Note: Stringification is not supported for the host name.

You can specify multiple targets for remote execution by using a list:

run-remote "1+2" on "ascl1", "ascl2"

Using run-remote this way does not get any information about the remote job that was executed. The job runs or fails without any further indication. Remote commands execute asynchronously which means run-remote commands return while the actual remote command is still executing.

To wait until the remote command processes or until an error occurs, invoke run-remote with the –wait option:

run-remote "1+2" on "ascl1" -wait

More control over remote execution provides the predefined RemoteTarget AutoShell class.

More Information

run-remote Command--Execute a Script on Remote Systems (Funclet)

Using the RemoteTarget Class