> For the complete documentation index, see [llms.txt](https://docs.mspp.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.mspp.io/ninjaone-billing-scripts/td-synnex-to-ninjaone-license-sync.md).

# TD Synnex to NinjaOne License Sync

This script allows you to bring your TD Synnex subscription information into NinjaOne license management. With the release of NinjaOne 13.0 this license information can be used by NinjaOne Billing as a quantity source to automatically invoice customers.

<figure><img src="/files/6D3O5I9JYXMvOjKK5AFX" alt=""><figcaption></figcaption></figure>

## **Requirements**

Make sure the [Getting Started](/ninjaone-auto-documentation/getting-started.md) guide has been followed

### **NinjaOne Products**

Core RMM

NinjaOne IT Asset Management (included in NinjaOne PSA)

### **Recommended Schedule**

Once per day

### **Role Setting Custom Fields**

<table data-full-width="true"><thead><tr><th>Display Name</th><th width="254.8">Name</th><th>Type</th><th>Permissions</th><th>Description</th></tr></thead><tbody><tr><td>TD Synnax Account ID</td><td>tdSynnaxAccountId</td><td>Secure</td><td><p>Technician: Editable<br>Automations: Read/Write</p><p>API: None</p></td><td>Your TD Synnax Account ID</td></tr><tr><td>TS Synnax Refresh Token</td><td>tdSynnaxRefreshToken</td><td>Secure</td><td><p>Technician: Editable<br>Automations: Read/Write</p><p>API: None</p></td><td>Your TD Synnax Refresh Token</td></tr></tbody></table>

### **Global Custom Fields**

None

## Setup

First login to TD Synnax StreamOne Ion. Go to your Account Information page and note your AccountID <https://ion.tdsynnex.com/v2/accounts/info>

Next create a new API User and give it Read Only Permissions. Save the user and then double click the user to Edit the user. On the edit page generate OAUTH Credentials and copy the refresh token. This refresh token can only be used once. The script wiill update the secure field with the new one after each use. But if someone goes wrong you may need to fetch a new token from here and manually update it in the future.

Set the obtained values into the TD Synnex custom fields you created on your automation machine.

Follow the details in the getting started guide for instructions on how to schedule this script.

There is a setting at the top of the script to let you choose to include the organization name in the license name or not.

## Matching

Organizations are matched based on the company name in TD Synnax to the Organization name in NinjaOne. If your names do not match you can edit the name override section at the top of the script to map the TD Synnax names to NinjaOne names.

## The Script

{% @github-files/github-code-block url="<https://github.com/lwhitelock/NinjaOneAutomation/blob/main/Billing_Scripts/TDSynnex_NinjaOne_Sync.ps1>" %}
