Already a NinjaOne customer? Log in to view more guides and the latest updates.

Secure Token Automation Scripts Explained

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

  1. Go to AdministrationLibraryAutomation in NinjaOne and open the Template Library tab. 
  2. Type "secure token" into the search bar. 

access template library.png
Figure 1: Access the Automation Template Library in NinjaOne

How to Use the Scripts

  1. Before running the scripts, create two (2) role custom fields. To learn how to create role custom fields, refer to Custom Field Setup.
    1. Create a text field titled "TokenName."
    2. Create a secure field titled "TokenPassword."
  2. Go to AdministrationDevicesRoles.
  3. Expand the Mac Desktops and Laptops section, hover your cursor over Mac Desktop, and click Edit. 

device roles_mac_edit desktop.png
Figure 2: Manage device roles and their custom fields

  1. Add the custom fields you created earlier in Steps 1.1 and 1.2. 
  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. 

username and custom field for secure token script.png
Figure 3: Add the username and password custom field for the script

  1. The device you are enabling the secure token will display a prompt. Input the username and password.

Additional Resources

FAQ

Next Steps