NinjaOne icon

NinjaOne

Consume NinjaOne API

Actions158

Management → Run Script On Device

AI-generated

Overview

This node allows you to run scripts or predefined actions on a specific device managed by the NinjaOne platform. It is useful for automating device management tasks such as executing maintenance scripts, running custom commands, or triggering built-in actions remotely on endpoints.

Typical use cases include:

  • Running diagnostic or remediation scripts on devices.
  • Triggering automated actions like software deployment or configuration changes.
  • Passing parameters to customize script execution per device.

For example, you might use this node to run a security scan script on a group of devices or execute a built-in action to restart a service remotely.

Properties

Name Meaning
Id Device identifier (number) specifying which device the script or action will run on.
Type Specifies whether to run a built-in action (ACTION) or a custom script (SCRIPT).
Id Script identifier (number) used when Type is SCRIPT to specify which script to run.
Uid Built-in action identifier (string) used when Type is ACTION to specify the action.
Parameters String containing parameters to pass to the action or script during execution.
Run As Credential role or identifier under which the script/action should be executed.

Output

The node outputs JSON data representing the response from the NinjaOne API after attempting to run the script or action on the specified device. The structure depends on the API response but generally includes status information about the execution request.

No binary data output is produced by this node.

Dependencies

  • Requires an active connection to the NinjaOne API using OAuth2 authentication.
  • The node expects a configured NinjaOne API credential in n8n to authenticate requests.
  • Network access to the NinjaOne API endpoint is necessary.

Troubleshooting

  • Missing or invalid device ID: Ensure the device identifier is correct and the device exists in NinjaOne.
  • Incorrect script or action identifiers: Verify that the script ID or built-in action UID matches those available in your NinjaOne environment.
  • Authentication errors: Confirm that the NinjaOne API credentials are valid and have sufficient permissions.
  • Empty or malformed parameters: If parameters are required by the script or action, ensure they are correctly formatted as strings.
  • API request failures: Check network connectivity and NinjaOne API status if requests fail.

Common error messages typically relate to invalid IDs, unauthorized access, or missing parameters. Reviewing the NinjaOne API documentation and ensuring proper input values usually resolves these issues.

Links and References

Discussion