> For the complete documentation index, see [llms.txt](https://docs.rewst.help/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rewst.help/rewst-documentation/documentation/integrations/integration-guides/ninjaone-integration-setup.md).

# NinjaOne integration

{% hint style="info" %}
If you’re new to integrations in Rewst, read through our introductory integration documentation [here](https://docs.rewst.help/documentation/integrations).
{% endhint %}

## What does the NinjaOne integration do?

Our NinjaOne integration provides users with a powerful combination of documentation, remote monitoring, and management capabilities. Seamlessly access and manage NinjaOne within Rewst, monitor and troubleshoot devices, deploy software, and perform remote tasks more effectively. Use this integration to centralize your IT documentation and RMM workflows, ensuring a comprehensive and streamlined approach to IT management within the Rewst platform.

## Set up the NinjaOne integration

### Set up steps in NinjaOne

1. Navigate to **Administration > Library > Automation**.
2. Click **Add**, then **New Script**.
3. Add the following script:
   1. Name: Rewst (Windows)
   2. Language: Powershell
   3. OS: Windows
   4. Architecture: All
   5. Paste the code below into the script box

{% hint style="info" %}
Your Rewst Base URL will vary depending on which Rewst instance you are on. You must update the $rewst\_base\_url property in the script below to match your Rewst Instance. You can identify which instance you are on by the URL you use to access Rewst. Please use the following table as a guide to identify your Rewst Base URL.\
Example of correct base URL: `https://engine.rewst.io/webhooks/custom/action`
{% endhint %}

| Rewst URL       | Base URL           |
| --------------- | ------------------ |
| app.rewst.io    | engine.rewst.io    |
| app.eu.rewst.io | engine.eu.rewst.io |
| app.rewst.eu    | engine.rewst.eu    |
| app.rewst.asia  | engine.rewst.asia  |

```powershell
Param(
    [Parameter(Mandatory=$true)]
    [string]$script_content_path,
    [Parameter(Mandatory=$true)]
    [string]$results_postdata_path
)

$rewst_base_url = "https://INSERTBASEURLHERE/webhooks/custom/action"
$script_content_url = "$rewst_base_url/$script_content_path"
$post_url = "$rewst_base_url/$results_postdata_path"



# Download Script Content from Rewst

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$wc = New-Object System.Net.WebClient
$wc.Encoding = [System.Text.Encoding]::UTF8
$commands = ($wc.DownloadString($script_content_url))

# Execute Script Content

iex $commands
```

<figure><img src="https://content.gitbook.com/content/h0G0em3PH6aDfPoI5XpN/blobs/R7DJ7q4Lxc5EJqDSLXtM/image%20(36).png" alt=""><figcaption></figcaption></figure>

### Set up steps in Rewst

1. Navigate to **Integrations** in the left side menu of your Rewst platform.
2. In the Integrations page, search for the NinjaOne integration.
3. Click on the integration tile to launch setup.
4. Choose your Region from the **Region Instance** drop-down selector.\ <br>

   <figure><img src="https://content.gitbook.com/content/h0G0em3PH6aDfPoI5XpN/blobs/sgjp4MttqIaZT7dCLuCV/image%20(37).png" alt=""><figcaption></figcaption></figure>
5. Click **Save Configuration**. This saving is necessary to ensure that there is no error in the next step.
6. Authorize OAuth into NinjaOne, via Microsoft. You should see your customer show up at the bottom. You may need to click **Refresh Options** for customers to populate.
7. Click **Save Configuration** again.
8. Rewst will do a quick validation of your input. Once completed, you'll see a new section beneath the configuration form for[ organization mapping](https://docs.rewst.help/documentation/integrations#what-is-organization-mapping). Complete your mapping as desired.&#x20;

{% hint style="info" %}
For APAC customers:

* When you click **Authorize** during the set up process, you end up at the URL <https://app.ninjarmm.com/auth/>.&#x20;
* If you change the **Region Instance** to APAC and click **Authorize**, you may still be redirected to the US site.
* Click **Save Configuration** first. Then, reload Ninja's website and ensure that it's showing the correct APAC region.
* Click **Authorize** again. The URL should now show the correct APAC address.&#x20;
  {% endhint %}

{% hint style="success" %}
Got an idea for a new Integration? Rewst is constantly adding new integrations to our integrations page. Submit your idea or upvote existing ideas here in our [Canny feedback collector](https://rewst.canny.io/integrations).
{% endhint %}

## Use custom PowerShell scripts with your RMM integration

This brand of RMM allows PowerShell scripts to be passed via API. To report the script back to Rewst, you'lll need to add a manual webhook action. We recommend using the run PowerShell script subworkflow to handle this for you and if using custom scripts you will need to add this to bottom to ensure the call back to Rewst is made.

```
$postData = $PS_Results | ConvertTo-Json
Invoke-RestMethod -Method 'Post' -Uri $post_url -Body $postData -ContentType 'application/json; 
charset=utf-8'
```

## Troubleshoot the NinjaOne integration

### All List component actions fail

If any list action is failing, ensure that you have added the script in previous instructions, into NinjaOne.

{% hint style="info" %}
Got an idea for a new Integration? Rewst is constantly adding new integrations to our integrations page. Submit your idea or upvote existing ideas here in our [Canny feedback collector](https://rewst.canny.io/integrations).
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.rewst.help/rewst-documentation/documentation/integrations/integration-guides/ninjaone-integration-setup.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
