Creating a Script for macOS Onboarding Exclusion

Jamf Pro Documentation 11.16.0

Solution
Application
Content Type
Technical Documentation
Utilities & Services
version
11.16.0
ft:locale
en-US
vrm_version
11.16.0

You can create a script that marks macOS Onboarding as complete on target computers. This allows you to use a policy to exclude a smart group of computers from running macOS Onboarding.

  1. In Jamf Pro, click Settings in the sidebar.
  2. In the Computer management section, click Scripts .
  3. Click New.
  4. Use the General pane to configure basic settings for the script, including the display name and category.
  5. Click the Script tab and enter one of the following scripts in the script editor:
    • For Self Service classic:

      #!/bin/zsh
      
      #get user
      loggedInUser=$( /usr/sbin/scutil <<< "show State:/Users/ConsoleUser" | awk '/Name :/ && ! /loginwindow/ { print $3 }' )
      #set preference
      su $loggedInUser -c "/usr/bin/defaults write ~/Library/Preferences/com.jamfsoftware.selfservice.mac.plist com.jamfsoftware.selfservice.onboardingcomplete -bool TRUE"
    • For Self Service+

      #!/bin/zsh
      
      #get user
      loggedInUser=$( /usr/sbin/scutil <<< "show State:/Users/ConsoleUser" | awk '/Name :/ && ! /loginwindow/ { print $3 }' )
      #set preference
      su $loggedInUser -c "/usr/bin/defaults write ~/Library/Preferences/com.jamf.selfserviceplus.plist com.jamfsoftware.selfservice.onboardingcomplete -bool TRUE"

    You can use the settings on the tab to configure syntax highlighting and theme colors in the script editor.

  6. Click the Options tab and configure additional settings for the script, including the priority and parameter labels.
  7. Click Save .