Getting Started

Contains the common setup instructions for all my NinjaOne Documentation scripts.

Step 1 - Select / Install a machine to run scripts

I highly recommend using a dedicated Windows Server Core machine for running scripts which will not be used for anything else. The machine used for scripts should not be accessible by anyone other than your System Administrator accounts. I also recommend running it as a VM in a secured data centre. This machine will get access to the API Keys for all of your services which is why it is important to keep it secure.

Step 2 - Create a new Organization

In NinjaOne create a new organization which will house the machine you wish to use for executing scripts.

Step 3 - Create a custom role for your script running machine

Depending on if you are using a Windows Desktop or Server operating system for executing scripts, create a new custom role under the corresponding role types inside NinjaOne

Step 4 - Update Technician Permissions

Update your technician roles and permissions to allow access to both the role and organization to only system administrators. This is because the machine needs to have access to secure custom fields which will store client_credentials API credentials. These credentials have the equivalent of system administrator permissions which are why these restrictions should be put in place.

Step 4 - Install NinjaOne Agent / Move Machine

Install the NinjaOne Agent for the new Organization you created or move the machine you wish to use to that organization. Once it is installed edit the device and update the role to be the new one you created.

Step 5 - Add Role Custom Fields

All the automated documentation scripts will require NinjaOne API details stored in secure custom fields. These should be role custom fields and only assigned to your script runner role. Some scripts will also require the addition of extra role fields to store API credentials for services they are integrating with as well as the addition of global custom fields to store the data that gets generated. The guides for specific integrations will detail what the requirements are.

The core role custom fields are:

Display Name
Name
Type
Permissions
Description

NinjaOne Client ID

ninjaoneClientId

Secure

Technician: Editable Automations: Read Only API: None

Stores the API Client ID

NinjaOne Client Secret

ninjaoneClientSecret

Secure

Technician: Editable Automations: Read Only API: None

Stores the API Client Secret

NinjaOne Instance

ninjaoneInstance

Text

Technician: Editable Automations: Read Only API: None

Stores the name of the NinjaOne Instance used for example app.ninjarmm.com or eu.ninjarmm.com

Please make sure the field names match exactly, it is possible to use different names if you wish, but this will require you to edit the automated documentation scripts.

Step 6 - Assign fields to your script role

Assign the newly created custom fields to the role you created.

Step 7 - Create API Credentials

Create a new Machine to Machine API application with client credentials authentication and the monitoring and management scopes.

Step 8 - Set the credentials at the device level custom fields

Set the credentials you generated at the device level custom fields for your script running machine.

Step 9 - Create Overview Company

Create a new company in NinjaOne called 'Global Overview' This is used for populating reports and other information across all companies.

Step 10 - Schedule scripts

Follow the setup instructions for specific scripts and then override the device policy to schedule them in.

Last updated