RemoteExec

public class RemoteExec

You can use the RemoteExec adapter to execute a given command on a specified target machine.

 Methods

RemoteExec(string computer, string user, string password, string command, string commandargs = null, string extraRemoteExecArgs = null)

The constructor

int RunProcess()

Run the process. If successful, the exit code of the process is returned

bool HasStartError()

Indicates whether there was a start error

string GetStartError()

Returns the start error that occured

string GetCommandLine()

Get a command line with the remoteExec file name and arguments

Example

This example shows how you execute Notepad on the specified computer as the session user

import clr
clr.AddReferenceToFileAndPath(Session.GetAdapterPath("IYOPRO.REMOTEEXEC"))
from IYOPRORemoteExecAdapter import RemoteExec

r = RemoteExec("_<device name>_", "", "", "notepad.exe", None, "-su -cs")
x = r.RunProcess()

print(r)
print(r.GetCommandLine())
print(r.HasStartError())