How to Execute a Script
When executing a script, a default credential must be specified or a credential must be assigned to the target machine or machine group.
All scripts can be executed using an ITScripts template. You can also execute a script directly without a template if the script does not require input parameters or if you want to use the default parameter values.
You can initiate the execution of a script from several different areas of the interface.
A console must trust the authority that issued the certificate in order to import or execute the script on that console. If you import user scripts on one console, they will appear on other consoles that are using the same database. If the other consoles don’t trust the signer, however, they will not be able to execute the scripts.
You can use the Agentless Operation page to execute a script on any of the four pre-defined groups (My Machine, My Domain, My Test Machines, Entire Network) or on a custom machine group.
- Type a name for the operation you are about to perform.
- Select the desired machine group(s).
- On the ITScripts tab, select how you want to execute the script.
- ITScript: When this option is selected, additional fields are displayed that let you:
- Choose the script you want to execute (scripts defined as target type = Console are not available here)
- Edit any parameters associated with the script
- ITScript template: When this option is selected, this area lets you choose the template you want to use when executing the script.
- Select when you want to execute the script (Now, Once, or Recurring).
- Click either Run or Schedule.
- Run: This is the button name if Now is your selected scheduling option. This will immediately begin executing the script on the machines in the machine group(s). The Operations Monitor is used to track the progress of the script.
- Schedule: This is the button name if Once or Recurring is your scheduling option. See Scheduling Scripts and Monitoring a Scheduled Script for more details.
One suggestion is to specify which machines are affected and the purpose of the operation (for example, Sample Group GetRebootTime). You may wish to include other identifiers such as the template being used, if it is a regularly scheduled operation or an out of band task, etc. A maximum of 80 characters can be used for the name.
A date and time stamp will be automatically appended to the name. If you do not specify an operation name, the date and time stamp will be used as the name.
You can review the results of the script using ITScripts Results View.
You can execute a script from within Machine View or Scan View by using right-click commands.
- Select one or more machines.
- Right-click the machine(s), select ITScripts, and then specify how you want to execute the script.
- Open prompt: Enables you to start a Windows PowerShell session with the selected machine. For details see Opening a PowerShell Prompt.
- Run script: Opens the Agentless Operation dialog, which enables you to run a script with or without a template.
- In the Machine Groups pane select the desired machine group.
- Within the machine group dialog click Run Operation.
- On the Agentless Operation dialog, select when and how you want to execute the script.
- ITScript: When this option is selected, additional fields are displayed that let you:
- Choose the script you want to execute (scripts defined as target type = Console are not available here)
- Edit any parameters associated with the script
- ITScript template: When this option is selected, this area lets you choose the template you want to use when executing the script.
- Click either Run or Schedule.
- Run: This is the button name if Now is your selected scheduling option. This will immediately begin executing the script on the machines in the machine group. The Operations Monitor is used to track the progress of the script.
- Schedule: This is the button name if Once or Recurring is your scheduling option. See Scheduling Scripts and Monitoring a Scheduled Script for more details.
You can review the results of the script using ITScripts Results View.
The Tools > Run console ITScripts command enables you to select and run Console mode scripts. These are scripts that are designed to run only on the console machine and not against target machines. The Run console ITScripts dialog is displayed.
This dialog enables you to run a console-only script with or without a template.
- If you choose a template you will execute the associated script using predefined parameter values.
- If you choose to run the script directly without a template you have the ability to modify the values of any input parameters associated with the script.
After making your selections, click Continue and use the Agentless Operation dialog to specify when the Console mode script should be run.