You can use RemoteExec with command line arguments to automate its execution. The default location of RemoteExec.exe is c:\program files\ISDecisions\RemoteExec5\. This path should have been added to the environment variables to invoke the RemoteExec command from anywhere.
At least one of these switches is required to specify Target Computers when you don't use a saved Job for a remote execution. You can repeat these switches to specify several computers name or several computer lists. To avoid a long repetition of Target Computers switches, you can save a list of machines.
/COMPUTER
ComputerName
Add a single computer to the Target Computers
list. You can also specify an IP address.
/COMPUTERLIST
ComputerListPath (.xml file)
Add a saved computer list file to the Target
Computers.
/MYCOMPUTERLIST
ComputerListName
Add a computer list saved in My Target Computers
to the Target Computers.
/DOMAIN
DomainName
Select all computers from the specified domain
as Target Computers.
/ACTION
ActionFilePath (.xml file)
Specify a saved Action to be executed
on the Target Computers.
/MYACTION ActionName
Specify an action saved in My Remote Actions.
Examples:
RemoteExec /COMPUTER
ComputerName
/MYACTION ActionName
RemoteExec
/COMPUTER ComputerName
/ACTION PathToXmlActionFile
RemoteExec /MYCOMPUTERLIST
ComputerListName /MYACTION
ActionName
/JOB JobFilePath
(.xml file)
Specify a saved Job to be executed.
/MYJOB JobName
Specify a Job saved in My Remote Jobs.
Example:
Jobs
can be specified without Target Computers
because they are already included.
RemoteExec /MYJOB JobName
RemoteExec /JOB PathToTheXmlJobFile
You can completely define a remote File execution from the command line.
/EXE FileToExecute
Specify the executable file to be executed remotely.
/FOLDER WorkingFolder
(Optional) Specify the Working
Folder for the remote execution.
/ARGS Argument(s)
(Optional) Specify optional Argument(s)
for the executable.
/CONTEXT Administrative/Interactive/FullAdministrative/System/SystemInteractive
(Optional) Specify the context
for the remote execution. If the context
is not specified, the remote execution is run in Administrative
context.
See File execution.
/USER AccountToUse
Force RemoteExec to use the mentioned account if the FullAdministrative
context is selected. The account should have been added in Impersonation
accounts first by using the GUI.
/NOWAIT
(Optional) Don't wait the end of the process before continuing.
By default RemoteExec always
waits the end of process.
/REBOOTIFNEEDED
(Optional) Reboot Target Computers after the remote execution
if some files require it
in order to be updated.
/NOCONSOLE
(Optional) Don't retrieve the console if the file is a console program.
By default the console is always retrieved when RemoteExec
detects the file to execute as a console file.
/CONSOLE
(Optional) Force the console mode if RemoteExec could not detect
that the executable is a console program..
/NOAUTO
(Optional) Don't request RemoteExec to choose automatically the best options.
By default RemoteExec automatically chooses the Verb and the files
copy mode.
/VERB verb
(Optional) The verb for the shell execution. The default verb
is open (default shell execute action).
/COPYMODE No/Temporary/Permanent
(Optional) Specify the copy mode to be used.
Example:
The following example does a remote command
prompt (like a telnet).
RemoteExec
/COMPUTER ComputerName
/EXE cmd
You can also completely define and execute a System action from the command line.
Switches that define a System action /REBOOT /SHUTDOWN /LOGOFF /LOCK /WAKEUP /ABORT Only one of these switches should be used. See the System action for more information.
/EXECUTIONMODE Immediate/ImmediateIfPossible/AlwaysNotify
(Optional) Says if the System
action execution should start immediately or after a notification
to the user.
/NOTIFYMODE ExecuteAfter/Periodic
(Optional) Says if the execution should take place after the notification time out or if the notification time represents a popup
period.
/NOTIFYTIME value in minutes
(Optional) The notification
will be displayed during this time or will popup periodically with this
time period.
/FORCE
(Optional) Force applications to close during a logoff, a reboot
or a shutdown.
/NOTIFYMESSAGE message
(Optional) Message that
will be displayed to the user.
/WAITTIME value in minutes
(Optional) How much time should RemoteExec
wait that the computer performed the shutdown, restart or wake up.
/NOWAIT
(Optional) Don't wait after initiating the shutdown, restart or
wake up.
/REBOOTIFNEEDED
(Optional) For a reboot System
action, launches the reboot
only if some files require it in order to be updated.
Examples:
RemoteExec /COMPUTER ComputerName /REBOOT
RemoteExec /MYCOMPUTERLIST TargetComputerListName /REBOOT /NOTIFYMESSAGE "Your computer was updated and need a reboot"
RemoteExec /COMPUTER ComputerName /WAKEUP
/POPUP
message
Specify a Popup message
to be displayed to users.
/POPUPTITLE
title
(Optional) Specify a title for the Popup window.
Examples:
RemoteExec /COMPUTER ComputerName /POPUP "Hello there"
RemoteExec /MYCOMPUTERLIST TargetComputerListName /POPUP "Hello to all of you" /POPUPTITLE "Notification"
The RemoteExec process will return:
0 If more than one Target Computer has been provided or if only one Target Computer has been provided and the remote process has been successfully started and exited with 0 as return code.
-1 if arguments provided to RemoteExec are not correct.
-2 Only one Target Computer has been provided and the remote execution failed for any reason.
-3 Only one Target Computer has been provided and the remote execution has been filtered out (e.g. wrong OS version, wrong language, ...).
-4 Only one Target Computer has been provided and the remote execution has succeeded but a reboot is needed to update the system.
If only one Target Computer has been provided and the remote execution has succeeded but the remote process returned an exit code that is not null then RemoteExec will return the same code.