Scripts in Qntrl | Qntrl | Bridge | Online Help | Larger script execution made easy in Qntrl

Scripts

Scripts module helps to simplify message execution for larger scripts. While simple commands can be executed directly in the Message module, complex larger scripts that involve a series of tasks or multiple commands can be saved as a script file in this module. The saved scripts can be executed in the specified machine by passing the script name in the JSON request of the message.

Create a Script   

To create a new script:

  1. Click the settings gear iconat the left pane.
  2. Navigate to Bridge >> choose Scripts.
  3. Click the New Script.
  4. Feed in the required new script details.
    1. Name: Give a name with a file extension to identify the script (Ex: display.sh/display.ps1).
    2. Description: Provide a description that serves for later reference.
    3. Script Type: Choose the type of script. 
      1. Shell ScriptFor UNIX-based systems
      2. PowerShell Script For Windows operating systems
      3. LDIF - For Windows Active Directory operations
    4. Script File: If the script is available in a local file you may attach it in this field, and it will be executed in the message.
    5. AI Script AssistantAlternatively, generate scripts using AI by providing a natural language prompt. You can insert the generated script directly into the editor or copy it for further modification. For more information, refer to AI Script Assistant.
    6. Click Save or Save and Execute. A new script will be created.

Notes
  • When a script file is uploaded, the file name is automatically populated in the Name field. You can modify it if required.
  • The contents of the uploaded file are automatically loaded into the script editor. 

AI Script Assistant

Use the AI Script Generator to create script content from natural language prompts without manually writing commands.

The generated script is based on the selected Script Type (Shell Script, PowerShell Script, or LDIF).  

Pre-requisite

For using AI script generator, enable AI Script Generator in Qntrl AI hub page. Refer here.

To generate script using AI:

  • Click the AI Script Assistant in the lower-left corner.

  • Enter a prompt describing the script you want to create


  • Click the Send icon.

  • The generated script is displayed based on the selected Script Type.

  • After the script is generated, you can:

    • Insert - Click + Insert, to insert the generated script directly into the Content editor.

    • Copy Code - Copies the generated script for further modification.

    • Reset - Click the Reset icon to clear the prompt and generated output and generate a new script.

    • Minimize - Click the Minimize icon to collapse the AI Script Generator panel.


  • Click Save or Save and Execute.


Script Execution

When a Bridge Message executes a script, Qntrl passes the script using the following request parameters based on the selected Script Type.

Script Type

Request Parameter

Shell Script

"command": "sh <SSH_DIR>/<scriptFileName>" (Ex: "sh <SSH_DIR>/display.sh")

PowerShell Script

"script-name": "<scriptFileName>.ps1" (Ex: "script-name": "display.ps1")

LDIF

"script-name": "<LDIF-File name>.ldif" (Ex: "script-name": "display.ldif")


Edit a Script   

To update an existing script:

  1. Navigate to(settings) >> Bridge >> select Scripts.

  2. In the list of scripts loaded, click on the script name you want to edit.

  3. Make the required modifications and click Save.


Delete a script   

To remove a script from Qntrl,

  1. Navigate to(settings) >> Advanced >> Bridge >> select Scripts.

  2. Hover over the name of the script you want to delete, click the mouse over action menu, and select the Delete menu item.

  3. Confirm the delete action.