Writing scripts ain't like dusting crops, kid! While mistakes made won't have you bouncing through a supernova, they can still cause headaches and extra work. But now, you can dodge those hassles by using AI to generate and tweak scripts tailored to your needs. This saves you time and effort, boosting your efficiency and productivity.
How it works
How are the script recommendations generated?
Atera’s native AI Copilot is built directly into the platform to help you generate scripts. From a set of simple or complex instructions, you're now able to generate powerful scripts in no time. It's the perfect combination of simplicity and sophistication.
What do I add to the instructions?
To generate a script, enter the specific commands or instructions that you want the script to execute when run. These instructions could include advanced tasks such as running other programs, performing calculations, or manipulating files or data.
What are the examples?
The example script descriptions are the most cloned scripts in Atera's Shared Script Library. We've provided these examples if you need help or inspiration in writing out script descriptions. When you select an example, the script's description will automatically populate in the Describe what the script should do field.
Note: You can always tweak the generated instructions to suit your specific needs, before generating a script.
Once AI Copilot has generated a script in chat, ask for any change in plain language (e.g., "add a 5-minute screen timeout" or "log to the event viewer"). AI Copilot shows the updated draft before you save or run it.
What happens when I create a script using AI Copilot?
As with any other script, it will appear in the My Scripts tab on the Scripts page. From here, it can be edited, shared with the Shared Script Library, and enabled for AI Copilot and Robin. And of course, it can be assigned to automation profiles and threshold profiles.
Generate and run scripts in chat
1. Describe what the script should do. AI Copilot checks your script library first and offers a match if one exists.
2. Review the draft. AI Copilot writes PowerShell, Batch or VBScript for Windows devices, and Bash for macOS and Linux, and picks the language from the device's OS. Scripts run as System unless you ask to run them as the logged-in user. A draft that can't run as written isn't offered to run, for example one with an input left unfilled or code that needs PowerShell 7.
3. Click Save to library or Run on this device. Saving needs the Manage scripts permission. By default, a script saved from chat isn't available to Robin. If AI Copilot asks who can use the script, choose the option that includes Robin. You can also turn on Enable for AI assistants and Enable for Robin on the script later.
4. Confirm the run. The result is posted to the chat when the device reports back. If the device is offline, choose how long to keep the script queued: 1 hour, 1 day, 1 week, 2 weeks or 1 month.
You can also ask AI Copilot to change a script that's already in your library. The change is saved to that same script only after you confirm.
Generate and edit scripts
After generating a script, you get to share its power - not just with your fellow technicians or the Atera community at large, but with your AI Copilot and Robin as well.
When generating scripts via:
- Copilot: script generator: The script name and description update automatically after generating a script, but won't automatically reflect any modifications made to the script, which must be done manually.
- Script editor: The script name and description will not update automatically to reflect changes made to the script. You can update them manually.
Note: We recommend reviewing and testing all generated scripts to ensure proper functionality.
via the script generator
To generate a script via the script generator:
1. Go to Admin > Monitoring and automation > Scripts.
The Scripts page appears.
2. Click Create script.
The Create script page appears.
3. Select the file type (.bat, .ps1, or .sh).
Note: We'll skip adding the script name and description as our trusty AI Copilot will populate those fields when generating the script.
4. Within AI Copilot: script generator, describe what the script should do. Then click Generate.
Note: You can select from any of the examples provided if you want to see example script descriptions.
The AI-generated script appears within the Script editor.
5. Make any necessary changes to the generated script.
6. Enable the script for AI Copilot and/or Robin. Learn more
7. Optionally, configure the following properties:
- Category: Enter the script category.
- Max script run time (in minutes): Enter the max run time (default is 10min).
- Arguments: Enter the script arguments.
- Run as: Choose System or Current user.
8. Click Create (top right of the page).
The script appears in the My Scripts tab, where it can be edited or shared to the Shared Script Library. You can also attach the script to automation profiles and threshold profiles
via the script editor
To generate a script via the script editor:
1. Go to Admin > Monitoring and automation > Scripts.
The Scripts page appears.
2. Select a script or click Create script.
The Create script page appears.
3. Enter the script name and select the file type (.bat, .ps1, or .sh).
4. Enter the script description.
5. Optionally, configure the following properties:
- Category: Enter the script category.
- Max script run time (in minutes): Enter the max run time (default is 10min).
- Arguments: Enter the script arguments.
- Run as: Choose System or Current user.
6. Within the Script editor, type "#" and describe what the script should do. Then press the Enter key.
7. Make any necessary changes to the generated script.
8. Enable the script for AI Copilot and/or Robin. Learn more
9. Click Create (top right of the page).
Note: You can easily modify the script using the same method used to create it - just add comments right in the script.
Scripts generated from recurring issues
Test scripts
Test PowerShell scripts (generated by the AI Copilot or yourself) on your devices, ensuring your scripts perform flawlessly.
Note: Running this script will execute actions on your selected device. We recommend using a dummy or test device to safely test your scripts.
To test a script via the script editor:
2. Select a device from the dropdown menu.
Note: Only online devices will appear.
The device's PowerShell terminal will appear below the script window.
3. Click the run now icon ().
The script will execute on the selected device.