It seems like your browser didn't download the required fonts. Please revise your security settings and try again.
Barracuda Managed Workplace

Adding a Script to Barracuda Managed Workplace

  • Last updated on

To set up tasks to use custom written 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 Managed Workplace version, author, description and all the parameters.

  1. In Service Center, click Automation > Library.
  2. Click New Script.
  3. In the Script Name box, type a name for the script.
  4. 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.
  5. In the Author box, type the author name.
  6. Click Browse and locate the script file or .ZIP file, and then click Open.
  7. 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 Managed Workplace.
  8. Select a category from the list or type a new one.
    Script categories allow for easier organization of scripts. A category can be created by typing in a new name. If you type a new name, Barracuda Managed Workplace creates a new category.
  9. In the Minimum Managed Workplace Version box, type the version of Barracuda Managed Workplace that this script supports.
    By default, the Minimum Managed Workplace 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 this is done, the script will be sent to Onsite Managers that are not the specified version number but will stay in a state of "Pending Upgrade" until Onsite Manager is upgraded or the schedule expires. Note however, that they can be assigned to devices on older Onsite Managers. If this is done, the script will be run on the device when Onsite Manager is upgraded, unless the execution time is in the past and the retry period has expired.
    You can locate Barracuda Managed Workplace 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.
  10. If you want the script to run on Onsite Manager, select the Run on Onsite Manager check box.
  11. If the script must run without another dedicated execution script running, select the Dedicated execution check box.
  12. 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.
  13. 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 Managed Workplace 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

The format of command line parameters varies by scripting language.

  1. Click the Use Command Line Parameters button.
  2. To set a default value, in the Default Value box, type the command.
  3. Click Save.
To add an integer parameter
  1. Click the Use Parameter List button.
  2. Click Add.
  3. From the Choose Parameter Type list, choose Integer.
  4. Click OK.
  5. To set a label for a script parameter, type a label in the Parameter Label box.
  6. To identify this parameter as unique, in the Parameter Key box, type a unique identifier. This key is the key expected by the script.
  7. To set the minimum and maximum values for a script parameter, type a minimum and maximum in the appropriate boxes.
  8. To set a default value for the script parameter, type a default in the Default box.
  9. To set this parameter as optional, select the Optional Parameter check box.
  10. Click OK.
To add a string parameter
  1. Click the Use Parameter List button.
  2. Click Add.
  3. From the Choose Parameter Type list, choose String.
  4. Click OK.
  5. To set a label for a script parameter, type a label in the Parameter Label box.
  6. To identify this parameter as unique, in the Parameter Key box, type a unique identifier. This key is the key expected by the script.
  7. To set the maximum length for the string parameter, type a length in the Maximum Length box.
  8. To set a default value for the string parameter, type a default in the Default box.
  9. To set this parameter as optional, select the Optional Parameter check box.
  10. Click OK.
To add a file parameter
  1. Click the Use Parameter List button.
  2. Click Add.
  3. From the Choose Parameter Type list, choose File.
  4. Click OK.
  5. To set a label for a script parameter, type a label in the Parameter Label box.
  6. To identify this parameter as unique, in the Parameter Key box, type a unique identifier. This key is the key expected by the script.
  7. To set this parameter as optional, select the Optional Parameter check box.
  8. Click OK.
To add a flag parameter
  1. Click the Use Parameter List button.
  2. Click Add.
  3. From the Choose Parameter Type list, choose Flag.
  4. Click OK.
  5. To set a label for a script parameter, type a label in the Parameter Label box.
  6. To identify this parameter as unique, in the Parameter Key box, type a unique identifier. This key is the key expected by the script.
  7. 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.

    Flag parameters must have a default value.

  8. Click OK.
To add a list parameter
  1. Click the Use Parameter List button.
  2. Click Add.
  3. From the Choose Parameter Type list, choose List.
  4. Click OK.
  5. To set a label for a script parameter, type a label in the Parameter Label box.
  6. To identify this parameter as unique, in the Parameter Key box, type a unique identifier. This key is the key expected by the script.
  7. In the List  Entries box, type the first entry in the list to the Add  unique  list entry box, then click the plus sign worddav41c26159bf655dcab1211d276a61745d.png.

    When specifying items in a list, you can include content in the list that will not be shown to the user that is filling in the parameters, by using a pipe character (|) and then providing the hidden content after the pipe character. The value after the pipe character is passed to the script. For example, if a script takes one of several integer values, but you want to present string values to the user, you can enter the following:

    First Entry | 1

  8. Repeat step 7 until you have added all entries in the list.
  9. 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.
  10. To select a default value for the list, select an entry from the Choose a default list.
  11. To set this parameter as optional, select the Optional Parameter check box.
  12. Click OK.
To add a password parameter
  1. Click the Use Parameter List button.
  2. Click Add.
  3. From the Choose Parameter Type list, choose Password.
  4. Click OK.
  5. To set a label for a script parameter, type a label in the Parameter Label box.
  6. To identify this parameter as unique, in the Parameter Key box, type a unique identifier. This key is the key expected by the script.
  7. To set this parameter as optional, select the Optional Parameter check box.
  8. 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.

  1. Select the check box beside one or more parameters.
  2. Click one of the following:
    • Move  Up
    • Move Down
To delete a script parameter
  1. Select the check box beside a script parameter.
  2. Click Delete.
Last updated on