Skip to main content

Run Queued Scripts

Summary

This script is scheduled to run every 3 days on the 'Machines With Queued Scripts' group by the CWM - Automate - Script - Queue Script script.

This script is designed to requeue itself every 3 days to ensure that it never enters the 'Fizzled' state.

The script retrieves stored data from the CWM - Automate - Custom Table - plugin_proval_queued_scripts table and executes the stored instances of scripts on the target machine.

Sample Run

This script should not be run manually.

Dependencies

Variables

Document the various variables in the script. Delete any section that is not relevant to your script.

NameDescription
TableNameWhat the variable represents.
sqlscriptIdThe script ID gathered from CWM - Automate - Custom Table - plugin_proval_queued_scripts.
sqlscriptparametersThe parameters for the script ID to be called, gathered from CWM - Automate - Custom Table - plugin_proval_queued_scripts.
GroupIDThe Group ID for the 'Machines With Queued Scripts' Group.

User Parameters

NameExampleRequiredDescription
SilentYesFalseWhen toggled to yes, the script will not utilize the scripting engine to run the selected scripts. Each script will be called with a Run Script command from this script. This means that you will not see the requested script in the scripts table or on the computer itself; however, any logging on the requested script will show up under the Run Queued Scripts entry in the target machine's script. The intention of this option is to provide a less intrusive method of executing the scripts. If you notice script engine slowdown or inflation, try this silent setting.

Process

  1. Retrieve the target computer's queued scripts from the custom table.
  2. Iterate through every entry for that target, executing each script with its parameters either silently or openly, depending on the silent value.
  3. Remove the queued script from the table after it has been executed.
  4. Once all scripts are executed, remove the machine from the group.

Output

  • Script log