Modify Scripts for Automation
    • Dark
      Light
    • PDF

    Modify Scripts for Automation

    • Dark
      Light
    • PDF

    Article Summary

    Some scripts might need to be modified to be used as an Automatic Action if they require additional user interaction. The following article describes some of the ways you can modify scripts for automation.

    Setting Argument Values for Interactive Scripts

    Because automated actions run independently, interactive scripts cannot be used. However, if you have an interactive script that you want to use as an automated action, you can use it if you set a default value for each of the arguments that would otherwise be supplied interactively.

    To set a default value for an argument:

    1. In a ControlUp Console, in the My Organization screen, in the Home ribbon bar, select Script Actions. The Scripts Management window opens.

    2. Double-click the script. The Modify Script Action window opens.

    3. In the Arguments tab, double-click an argument whose default value you want to set. The Script Argument dialog box opens.

    4. Under Default, enter the default value for the argument, and then select OK. The value appears in the list of arguments, under Default.
      image.png

    5. Repeat the last two steps for every other argument whose default value you want to set.

    6. Select OK, and then, in the Scripts Management window, select Close.

    Specifying Default Credentials for an Interactive Script

    Script Actions whose security context is Prompt upon execution, which receive their credentials interactively, cannot be used as automated actions unless default shared credentials are specified in the script settings.

    When no default shared credentials are specified for these types of Script Actions, they appear in gray in the list of available scripts for a trigger. If you select one, a notification like the one in the illustration below is added to the Follow-up Action screen. If you have the Manage Script Actions permission, you can specify the credentials to use in the script’s settings. In this case, a Click here to edit the Script Action link also appears.
    image.png

    Note

    If you set up default credentials for a script to use when it runs automatically, as explained here, and the script is later run manually, the user is still prompted to enter the credentials to use. The credentials specified in the script’s settings appear as the default credentials, but they can be modified.

    To specify the credentials a Script Action should use:

    1. In the Follow-up Action screen, select Click here to edit the Script Action. The script’s Properties window opens.

    2. In the Settings tab, under Security Context, in the Default shared credentials for automation field, select the credentials to use when the script is run automatically.
      360003593777image047.png

    3. Select OK.

    Specifying Default (Current User) Credentials for Running a Script

    Script Actions whose security context is Default (Current User) cannot be used as automated actions because no Current User is defined for them. In order to enable such scripts to be used as automated actions, default shared credentials must be specified in the script settings.

    When no default shared credentials are specified for these types of Script Actions, they appear in gray in the list of available scripts for a trigger. If you select one, a notification like the one in the illustration below is added to the Follow-up Action screen. If you have the Manage Script Actions permission, you can specify the credentials to use in the script’s settings. In this case, a Click here to edit the Script Action link also appears.
    360003593797image0451.png

    Note

    If you set up default credentials for a script to use when it runs automatically, as explained here, and the script is later run manually, the credentials of the current user are used.

    To specify the credentials an automated-action script should use instead of Default (Current User):

    1. In the Follow-up Action screen, select Click here to edit the Script Action . The script’s Properties window opens.

    2. In the Settings tab, under Security Context , in the Default shared credentials for automation field, select the credentials to use when the script is run automatically.
      image.png

    3. Select OK .

    Specifying the Computer on which to Run a Script

    Script Actions whose execution context is Other computer prompt the user to select the computer on which they will run, and therefore cannot be used as automated actions. In order to enable them to be used as automated actions, the computer on which to run them can be specified in the Script Action’s settings.

    When no default computer is specified for these types of Script Actions, they appear in gray in the list of available scripts for a trigger. If you select one, a notification like the one in the illustration below is added to the Follow-up Action screen. If you have the Manage Script Actions, you can specify the computer to use in the script’s settings. In this case, a Click here to edit the Script Action link also appears.
    image.png

    Note

    If you specify a default target computer for a script to use when it runs automatically, as explained here, and the script is later run manually, the user is still prompted to select the computer to use. The computer in the script’s settings appears as the default, but it can be modified.

    To specify the computer on which the Script Action should run:

    1. In the Follow-up Actionscreen, select Click here to edit the Script Action. The script’s Properties window opens.

    2. In the Settings tab, under Execution Context, select the360003593957image053.gifbutton. A Choose Computer dialog box opens.
      image.png
      image.png

    3. In the grid, select the computer to run the script on when it is run automatically, and then select OK. The dialog box closes and the selected computer appears in the script’s Execution Context settings.
      image.png

    4. Select OK.

    Setting Up Pass-Through Authentication

    If you do not want to include a plaintext password in a PowerShell Script Action, you can use pass-through authentication instead. To do this, you must configure the script to run on the Console with the Default (Current User) security context and specify appropriate default shared credentials. Then, do not specify any credentials for the script to use when it connects to VIServer. The lack of credentials there invokes pass-through authentication, and the default credentials you specified will be used to connect to VIServer and run the script.

    To set up pass-through authentication for a PowerShell script, in the script’s settings, configure the following:

    Setting

    Configuration

    Execution Context

    Select ControlUp Console.

    Security Context

    1.  Select Default (Current User).

    2.  Under Default shared credentials for automation, select the credentials to use.

    image.png



    Was this article helpful?