Topic
This article answers frequently-asked questions about using the Automation Library in NinjaOne.
Environment
NinjaOne Endpoint Management
Index
Select a question to review the answer:
- Will NinjaOne queue scripts that couldn’t run during scheduled automations?
- How long will pending scripts stay in the queue?
- What version of PowerShell does NinjaOne Automation use?
- Can I restrict or assign script access to specific technicians or users?
- Does NinjaOne officially support bash scripts?
- Will my script run as System or as the current user?
- If I edit a script in the library, will this affect existing scheduled scripts and tasks?
- What happens if I delete a script that is referenced in a scheduled script or task?
- Can I upload a script to run against both macOS and Windows devices?
- Can I view and edit the built-in scripts/actions?
- Is there a character limit for new categories that I create?
- How do parameters work with my custom scripts?
- What happens if I attempt to issue a reboot via a custom script?
- Is it possible to restore a deleted script?
- Are scripts encrypted when I transmit them from NinjaOne to an endpoint's local library?
- Why is my script reporting a failure when I know it succeeded?
FAQ
Will NinjaOne queue scripts that couldn’t run during scheduled automations?
Scheduled automations will not execute scripts unless the device is online at the time the action is scheduled. Instead, NinjaOne will cancel the script and log an activity to notify of this event.
How long will pending scripts stay in the queue?
NinjaOne will not remove or cancel queued scripts regardless of time.
What version of PowerShell does NinjaOne Automation use?
The version NinjaOne uses depends on the PowerShell version installed on the agent running the script. The agent determines the PowerShell version, rather than NinjaOne. Typically, PowerShell 2 and above is used, but you can find exceptions in the script notes.

Can I restrict or assign script access to specific technicians or users?
Yes. You can manage access from a technician role or account page through Permissions → Automation Library. Select the permission level you want the technician to have for all categories by default, or manage permissions for individual categories.

You can restrict installed and run automations to categories by performing the following steps:
- In NinjaOne, navigate to Administration → Library → Automation.
- Open the Categories tab and click Create category.

- Enter a unique identifier for the Name and then click Create.
- Open the Automations tab.
- Move your mouse cursor over the script you want to add to a category and select the actions menu. Click Edit.

- Select the checkboxes for each category you would like to add the script to, and then click Save.
Does NinjaOne officially support bash scripts?
NinjaOne supports Bash scripts; however, it is not within the scope of the NinjaOne Support Team to troubleshoot customer scripts, and we cannot determine whether the root cause is the script itself.
Will my script run as the system or as the current user?
When you run a script on a device (whether via a scheduled task, a scheduled script, or ad hoc), NinjaOne will prompt you to specify whether to run the script as the system, the current user, or with credentials from your credential store.
If I edit a script in the library, will this affect existing scheduled scripts and tasks?
Yes. Any edits you make in the library will be propagated to all scheduled scripts or tasks that reference the script.
What happens if I delete a script that is referenced in a scheduled script or task?
NinjaOne will no longer reference the script in the scheduled script or task.
Can I upload a script to run against both macOS and Windows devices?
NinjaOne does not support scripts that run across multiple platforms. However, you can upload a script for each Apple macOS and Windows platform separately.
Can I view and edit the built-in scripts or actions?
You can only view and edit the scripts that you created. You cannot edit native scripts that NinjaOne provides by default.
Is there a character limit for new categories that I create?
Yes. There is a 50-character limit for category names.
How do parameters work with my custom scripts?
For an explanation of parameters, refer to NinjaOne Endpoint Management: Automation Parameters and Environment Variables.
What happens if I attempt to issue a reboot via a custom script?
Since the NinjaOne agent cannot plan for reboots triggered by custom scripts, this action may cause issues with the agent.
To resolve the issue, either delete the custom script in question or modify it to remove the lines in the script that issue a reboot. You can use a NinjaOne automation to issue reboots on machines.
Is it possible to restore a deleted script?
It is not possible to restore deleted scripts. You must create them again.
Are scripts encrypted when I transmit them from NinjaOne to an endpoint's local library?
Yes. The transmission of a script from the server to the agent is encrypted, as are all other communications between the NinjaOne servers and NinjaOne Agent.
Why is my script reporting a failure when I know it succeeded?
NinjaOne counts any exit code other than 0 as a failure. Ensure your scripts exit with code 0 if successful; otherwise, Ninja will report they failed.