To set up tasks to use custom scripts, you must first add the scripts you need to the script library and specify any metadata for the script. This includes the name, underlying script file, category, version, minimum Barracuda RMM version, author, description, and all the parameters.
- In Service Center, click Automation > Library.
- Click New Script.
- In the Script Name box, type a name for the script.
- In the Version box, type a number.
Versions for scripts must be in the form of <num>.<num>[.<num>[.<num>]], though only a single number is required. - In the Author box, type the author name.
- Click Browse and locate the script file or the .ZIP file, and then click Open.
- If the script file you added was a compressed file (such as a .ZIP), then select the starting file from the Starting File list.
The starting file in the .ZIP file must be at the root level of the .ZIP file and have a file extension that is recognized by Barracuda RMM. - Select a category from the list or type a new one.
Script categories allow for organization of scripts. A category can be created by typing in a new name. If you type a new name, Barracuda RMM creates a new category. - In the Minimum Barracuda RMM Version box, type the version of Barracuda RMM that this script supports.
By default, the Minimum Barracuda RMM Version is not automatically populated with the current version of Service Center, but this is usually the value you want to enter. If you need to specify that it only works with the current version, type the current version number. If the current version is entered, the script is sent to Onsite Managers that are not the specified version number but stay in a "Pending Upgrade" state until Onsite Manager is upgraded or the schedule expires.
You can locate Barracuda RMM build numbers in the correct format by clicking Help > About Manager check box.
When there is a new version of a script, Onsite Manager checks the minimum version and determines whether to download the file from Service Center. - If you want the script to run on Onsite Manager, select the Run on Onsite Manager check box.
- If the script must run without another dedicated execution script running, select the Dedicated execution check box.
- In the Target Type area, do the following:
- To specify that the script can run on any platform type, select the Any platform option button.
- To specify that the script can run on specific platforms, select the Specific platform option button, and then select the check box beside the operating systems on which the script will run.
- In the Description box, type a description.
This description is shown to users when they create tasks for the script. It is a good idea to describe how to use any parameters for the script.
Now you are ready to add parameters to the script. If you do not want to add parameters, select the No Parameters option button.
To add parameters to a script using a command line
Barracuda RMM allows you to use scripts as if you were running them directly on the system using command lines. When adding parameters to a script, you can simply specify the parameters as if you were running them on the command line. For example, the following is a PowerShell command line parameter:
-server[ "http://someserver" |http://someserver/]-force
- Click the Use Command Line Parameters button.
- To set a default value, in the Default Value box, type the command.
- Click Save.
To add an integer parameter
- Click the Use Parameter List button.
- Click Add.
- From the Choose Parameter Type list, choose Integer.
- Click OK.
- To set a label for a script parameter, type a label in the Parameter Label box.
- To identify this parameter as unique, in the Parameter Key box, type a unique identifier. This key is the key expected by the script.
- To set the minimum and maximum values for a script parameter, type a minimum and maximum in the appropriate boxes.
- To set a default value for the script parameter, type a default in the Default box.
- To set this parameter as optional, select the Optional Parameter check box.
- Click OK.
To add a string parameter
- Click the Use Parameter List button.
- Click Add.
- From the Choose Parameter Type list, choose String.
- Click OK.
- To set a label for a script parameter, type a label in the Parameter Label box.
- To identify this parameter as unique, in the Parameter Key box, type a unique identifier. This key is the key expected by the script.
- To set the maximum length for the string parameter, type a length in the Maximum Length box.
- To set a default value for the string parameter, type a default in the Default box.
- To set this parameter as optional, select the Optional Parameter check box.
- Click OK.
To add a file parameter
- Click the Use Parameter List button.
- Click Add.
- From the Choose Parameter Type list, choose File.
- Click OK.
- To set a label for a script parameter, type a label in the Parameter Label box.
- To identify this parameter as unique, in the Parameter Key box, type a unique identifier. This key is the key expected by the script.
- To set this parameter as optional, select the Optional Parameter check box.
- Click OK.
To add a flag parameter
- Click the Use Parameter List button.
- Click Add.
- From the Choose Parameter Type list, choose Flag.
- Click OK.
- To set a label for a script parameter, type a label in the Parameter Label box.
- To identify this parameter as unique, in the Parameter Key box, type a unique identifier. This key is the key expected by the script.
Provide a default value for the flag parameter, by either selecting the Default Value check box for a true value, or leaving the Default Value check box cleared for a false value.
- Click OK.
To add a list parameter
- Click the Use Parameter List button.
- Click Add.
- From the Choose Parameter Type list, choose List.
- Click OK.
- To set a label for a script parameter, type a label in the Parameter Label box.
- To identify this parameter as unique, in the Parameter Key box, type a unique identifier. This key is the key expected by the script.
In the List Entries box, type the first entry in the list to the Add unique list entry box, then click the plus sign .
- Repeat step 7 until you have added all entries in the list.
- Optionally, select an entry in the list, and use the up and down arrow buttons to move the entry in the list. The list items are presented to the user in the same order that they appear in the List Entries box.
- To select a default value for the list, select an entry from the Choose a default list.
- To set this parameter as optional, select the Optional Parameter check box.
- Click OK.
To add a password parameter
- Click the Use Parameter List button.
- Click Add.
- From the Choose Parameter Type list, choose Password.
- Click OK.
- To set a label for a script parameter, type a label in the Parameter Label box.
- To identify this parameter as unique, in the Parameter Key box, type a unique identifier. This key is the key expected by the script.
- To set this parameter as optional, select the Optional Parameter check box.
- Click OK.
To change the order of script parameters
After adding parameters to a script, you can change the order in which they appear to the user scheduling the task, by moving parameters up and down in the list.
- Select the check box beside one or more parameters.
- Click one of the following:
- Move Up
- Move Down
To delete a script parameter
- Select the check box beside a script parameter.
- Click Delete.