Topic
This guide explains the extra steps required to use the Secure Token script templates in NinjaOne's Automation Library.
Environment
NinjaOne Automation Library
Description
How the Scripts Work
The script named "Secure Token Check - macOS" shows the current secure token status for all accounts on the system.
The script "Create Secure Token for Account" grants secure token access to a Service Account. If the account does not exist, it will be created as a service account. Service Accounts do not show up when logging in to the desktop.
Both of these scripts work with macOS and use the ShellScript language.
Where to Find the Scripts
- Go to Administration → Library → Automation in NinjaOne and open the Template Library tab.
- Type "secure token" into the search bar.

Figure 1: Access the Automation Template Library in NinjaOne
How to Use the Scripts
- Before running the scripts, create two (2) role custom fields. To learn how to create role custom fields, refer to Custom Field Setup.
- Create a text field titled "TokenName."
- Create a secure field titled "TokenPassword."
- Go to Administration → Devices → Roles.
- Expand the Mac Desktops and Laptops section, hover your cursor over Mac Desktop, and click Edit.

Figure 2: Manage device roles and their custom fields
- Add the custom fields you created earlier in Steps 1.1 and 1.2.
- Import and run the script from the Template Library. A configuration modal should display, requiring a new account username and password.
- The New Account Username field should include a user who is not a system administrator on the device.
- Add the "TokenPassword" custom field into the New Account Password Custom Field field.

Figure 3: Add the username and password custom field for the script
- The device you are enabling the secure token will display a prompt. Input the username and password.