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

Secure Token Automation Scripts

Topic

This guide explains the extra steps required to use the Secure Token Check - macOS script template in NinjaOne's Automation Library.

Environment

NinjaOne Automation Library

Description

The script named Secure Token Check - macOS shows the current secure token status for all accounts on the system. You will typically use tokens for Apple macOS patch management; refer to NinjaOne Patching: Apple macOS Patching Policy Setup for more information.

The script Create Secure Token for Account grants secure token access to a service account. If the account does not exist, the script will create one as a service account. Service accounts do not appear when logging in to the desktop.

Both of these scripts work with macOS and use the ShellScript language. 

Where to Find the Scripts

You can find native scripts in our Automation Library.

  1. Navigate 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

Before running the scripts, create two role custom fields. To learn how to create role custom fields, refer to NinjaOne Custom Fields: Getting Started. Then, perform the following steps.

  1. Create a text field titled TokenName.
  2. Create a secure field titled TokenPassword.
  3. Navigate to AdministrationDevicesRoles.
  4. Expand the Mac Desktops and Laptops section, move your mouse cursor over Mac Desktop, and click Edit.

edit mac desktop device role.png
Figure 2: Manage device roles and their custom fields

  1. Add the custom fields you created earlier in Steps 1 and 2. 
  2. Import and run the script from the Template Library.
    • The New Account Username field should include a user who is not a system administrator on the device.
    • Add the TokenPassword custom field to 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 on will display a prompt. Input the username and password.

Additional Resources

Use the following resources to optimize your experience with NinjaOne automation tools.

FAQ

Next Steps