How to create an AI Assisted Script
Artificial Intelligence Assisted Scripting is only available at the Service Organization level.
-
Select your Service Organization in the N-central dashboard.
-
Click Configuration > Scheduled Tasks > Script/Software Repository.
-
Click Add > AI Assisted Scripting.
-
Populate the script fields:
-
Name: to identify the script in the repository.
-
Description: what the script does and additional details.
-
Language: currently only support English.
-
Script Type to Generate: from Batch Script (Windows), PowerShell and VBScript.
-
Script Instructions: details of your script's intended actions; this serves as the prompt provided to ChatGPT to generate the script. For example, “Given a specific directory path (e.g., the user's 'Documents' folder), scan through all the subfolders. For each subfolder, I want the script to calculate the total size of files contained within it. If the folder size exceeds a 100 MB, the script should report the folder's name and its size in a readable format. Please include comments in the script.”
-
Handle null values: manage situations where variables or data lack assigned values.
-
Handle Exceptions: manage unexpected errors or conditions.
-
-
Once configured, click Generate the script to pass these details to ChatGPT and create the script.
To use AI Assisted Scripting, you must first review and consent to the AI Scripting – Terms of usage then enter your ChatGPT account token (API Key) when prompted. If you declined the terms then later decide to accept them, select Click here to configure the Account Token in the Add script dialog, or go to Administration > Defaults > AI Assist Account Token.
Review and modify the script
The script returned by ChatGPT appears in the editable Resulting Script text box. In this box you can review and modify the script to ensure that it matches your precise requirements.
If the script does not function as expected and requires some larger changes, you can tweak the Script Instructions then click on Generate the Script to create an updated version.
Once the script is ready, we recommend that you Download as file to your computer to test locally.
Add any “Command Line Parameters” the values or arguments passed to the script when executing to customize its behavior without altering the script itself. By default, this is the scrip name.
Click Save to Repository where it will be ready for deployment as a scheduled tasks.
After adding the script, you can action changes by following the steps outlined in Review Scripts in the N-able N-central repository.
Read More