Note: A No Approved Shell Command
message displays in the Choose the command to execute in a command shell drop-down list if no SQL commands have been manually added to the Kaseya Server, as described below.
Executes a shell command on the Kaseya Server from the following file locations.
<Kaseya_Installation_Directory>\xml\SDProcShellCommand\0
- Files stored in the 0
directory are available in every partition.
<Kaseya_Installation_Directory>\xml\SDProcShellCommand\1
- The 1
directory in this example matches partition ID 1. Files stored in a partition-specific directory are available only in that partition.Shell commands stored in these locations are formatted as XML files and can have any filename. You can have multiple commands in one XML file. You can also have multiple XML files.
Example
The XML should be structured like the following example, which includes 2 shell commands.
<?xml version="1.0" encoding="utf-8" ?>
<shellCommandList>
<shellCommandDef label="Shell Command 1" commandToExecute="echo hello" waitForCompletion="true" sendOutputToLog="true" outputFile="c:\temp\fromcmd.log" outputVariable="" />
<shellCommandDef label="Shell Command 2" commandToExecute="echo hello" waitForCompletion="true" sendOutputToLog="true" outputFile="c:\temp\fromcmd2.log" outputVariable="" />
</shellCommandList>
Definitions
label
- The name that displays in the drop-down list of available commands to execute. Should be informative of what the shell command does. Required.commandToExecute
- The shell command. Required.waitforCompletion
- True to wait. False to not wait. Required.sendOutputToLog
- True to send output. False to not send output. Required.At least one of the following is required. If both are filled in outputFile
has precedence.
outputFile
- Full file path and name where the output is saved if sendOutputToLog is true. Optional.outputVariable
- Name of the variable the output goes to. Optional.