Shortcuts and Jamf APIs: Customize and Extend Your Jamf Experience

With Damian Cavanagh, PreSales Engineer, CompNow (Australia)

Jamf’s APIs provide admins with a powerful toolset for advanced device management.

Apple’s Shortcuts automation utility can interact with these APIs, enabling greater customization and flexibility for admin workflows and an even better user experience.

Thanks for watching my session at JNUC! Or knowing someone who did…
All the Shortcuts used in the session are available for you to download and experiment with below. Feel free to share this page with colleagues who may be interested – if these Shortcuts save admins as much time as I hope they will, I’d like as many as possible to hear about it!

Please send any feedback or questions to me via the MacAdmins Slack – I’m @d.cav.

If you’d like an update when I add more Shortcuts to this page, please send me an email here and I’ll add you to a list.

Below, I will talk you through all of the shortcuts and provide links to download them.

Depending on your device/browser security settings, you may have difficulty downloading the Shortcut files – they may be interpreted as scripts. (Keeping things on the JNUC theme, downloading them might trigger an alert in Jamf Protect!)
If you run into this issue, please use the iCloud link instead – If you are using the OneDrive then once open choose to open in another app and choose Shortcuts and it will work for you.

Damian_Cavanagh_Headshot_JNUCThumbnail

Generate Test Device Serial Number QR Code

Before we get to the actual shortcuts, I want to help you avoid the hassle of printing a serial number QR code label while you’re just experimenting. This Shortcut will prompt you to enter the serial number of your test device when you install it. I recommend you run this on your own Mac, with the test device beside it, and your iPhone/iPad in your hand running the Shortcuts.

If using multiple test devices, you can duplicate the Shortcut and enter a new serial in the existing Text action.

Shortcut Download Link (OneDrive) or Shortcut Download Link (iCloud)

HOW TO USE THE SHORTCUTS

  • Jamf Pro:

    First, create a Jamf Pro account for exclusive use with these Shortcuts, and add permissions as noted below for only the Shortcuts you wish to test.
    Then, before you install any Shortcuts, download ToolBox Pro from the App Store and create two Variables:
    Jamf Pro URL – https://yourdomain.jamfcloud.com
    Jamf Pro API Auth – username:password (Shortcuts handles the base64 encoding)

    *Using Variables in TBP does not require an in-app purchase
    After completing these steps, download the Shortcut file(s) on your iPhone/iPad, or download on Mac and AirDrop/email etc

  • Jamf School:

    Get your Network ID from Devices/Enrol Device(s), and then create an API key via Organisation/Settings/API
    Then, before you install any Shortcuts, download ToolBox Pro from the App Store and create two Variables:
    Jamf School URL – https://yourdomain.jamfcloud.com
    Jamf School API Auth – NetworkID:APIKey (Shortcuts handles the base64 encoding)

    *Using Variables in TBP does not require an in-app purchase
    After completing these steps, download the Shortcut file(s) on your iPhone/iPad, or download on Mac and AirDrop/email etc

  • On Security:

    Some organisations may not permit usage of their MDM’s API in this fashion – please check on this!

    The TBP variable approach is the best solution I have been able to come up with to avoid having auth details in the Shortcuts themselves. TBP uses iCloud for storage/syncing which I find secure enough, but do not use on a mobile device without passcode/Touch ID/Face ID.

    Replacing TBP Variables with Text Actions with the relevant data is an alternative.

Jamf Pro – Main

JP – Mac – Get Computer & User Info

Shortcut Download Link (OneDrive)
Shortcut Download Link (iCloud)

Description:
Return computer & user information.

  • Required Modules

    • JP – Mac – Get computer record from serial
    • JP – User – Get User record from username
  • Permissions: 

    • Read – Computers
    • Read – Users
Jamf Pro – Module

JP – Mac – Get computer record from serial

Shortcut Download Link (OneDrive)
Shortcut Download Link (iCloud)

Description:
Returns computer record as JSON dictionary.

  • Required Modules

    • N/A
  • Permissions: 

    • Read – Computers
MultipurposeShortcutModule
Jamf Pro – Main

JP – Mac – Command – Choose

Shortcut Download Link (OneDrive)
Shortcut Download Link (iCloud)

Description:
Choose which command to send to computer
Supports following commands:
UnmanageDevice, BlankPush, SettingsEnableBluetooth, SettingsDisableBluetooth, EnableRemoteDesktop, DisableRemoteDesktop, ScheduleOSUpdate, DeviceLock, EraseDevice
Requests 6-digit code when required for command (i.e. Lock & Erase)

  • Required Modules

    • JP – Mac – Get computer record from serial
    • JP – Mac – Mac – Command – Choose – Mod
  • Permissions: 

    • Read – Computers
    • Create – Computers
    • Send Computer [commandName] (Jamf Pro Server Actions) – enable for all commands
Jamf Pro – Module

JP – Mac Command – Choose – Mod

Shortcut Download Link (OneDrive)
Shortcut Download Link (iCloud)

Description:
Supports main Shortcut.

  • Required Modules

    • N/A
  • Permissions: 

    • Create – Computers
    • Send Computer [commandName] (Jamf Pro Server Actions) – enable for all commands
MultipurposeShortcutModule
Jamf Pro – Main

JP – Mac – Add to Group

Shortcut Download Link (OneDrive)
Shortcut Download Link (iCloud)

Description:

Add Mac to Static Group
Set up for group “JNUC Test” – either create this group in Jamf Pro or edit this to an existing group
  • Required Modules

    • JP – Mac – Get computer record from serial
    • JP – Mac – Add to Group – mod
  • Permissions: 

    • Read – Computers
    • Create – Computers
    • Send Computer [commandName] (Jamf Pro Server Actions) – enable for all commands
Jamf Pro – Module

JP – Mac – Add to Group – Mod

Shortcut Download Link (OneDrive)
Shortcut Download Link (iCloud)

Description:
Supports main Shortcut.

  • Required Modules

    • N/A
  • Permissions: 

    • Read – Computers
    • Update – Static Computer Groups (for static groups)
MultipurposeShortcutModule

Check out what’s new with Apple from CompNow
Or continue scrolling for Jamf device shortcuts

Jamf Pro – Main

JP – Device – Get Device & User Info

Shortcut Download Link (OneDrive)
Shortcut Download Link (iCloud)

Description:
Return mobile device & user information.

  • Required Modules

    • JP – Device – Get Record from Serial
    • JP – User – Get User record from username
  • Permissions: 

    • Read – Mobile Devices
    • Read – Users
Jamf Pro – Module

JP – Device – Get Record from Serial

Shortcut Download Link (OneDrive)
Shortcut Download Link (iCloud)

Description:
Returns mobile device record as JSON dictionary

  • Required Modules

    • N/A
  • Permissions: 

    • Read – Mobile Devices
MultipurposeShortcutModule
Jamf Pro – Main

JP – Device – Command – Choose

Shortcut Download Link (OneDrive)
Shortcut Download Link (iCloud)

Description:
Choose which command to send to computer
Supports following commands:
Settings, EraseDevice, ClearPasscode, UnmanageDevice, UpdateInventory, ClearRestrictionsPassword, SettingsEnableDataRoaming, SettingsDisableDataRoaming, SettingsEnableVoiceRoaming, SettingsDisableVoiceRoaming, SettingsEnableAppAnalytics, SettingsDisableAppAnalytics, SettingsEnableDiagnosticSubmission, SettingsDisableDiagnosticSubmission, SettingsEnableBluetooth, SettingsDisableBluetooth, SettingsEnablePersonalHotspot, SettingsDisablePersonalHotspot, BlankPush, ShutDownDevice, RestartDevice, PasscodeLockGracePeriod, EnableLostMode, DisableLostMode, DeviceLocation, PlayLostModeSound

  • Required Modules

    • JP – Device – Get Record from Serial
    • JP – Device command – choose – mod
  • Permissions: 

    • Read – Mobile Devices
    • Create – Mobile Devices
    • Send Mobile Device [commandName] (Jamf Pro Server Actions) – enable for all commands
Jamf Pro – Module

JP – Device – Command – Choose – Mod

Shortcut Download Link (OneDrive)
Shortcut Download Link (iCloud)

Description:
Supports main Shortcut

  • Required Modules

    • N/A
  • Permissions: 

    • Create – Mobile Devices
    • Send Mobile Device [commandName] (Jamf Pro Server Actions)
MultipurposeShortcutModule
Jamf Pro – Main

JP – Device – Add to Group

Shortcut Download Link (OneDrive)
Shortcut Download Link (iCloud)

Description:
Add Mobile Device to Static Group
Set up for group “”JNUC Test”” – either create this group in Jamf Pro or edit this to an existing group

  • Required Modules

    • JP – Device – Get Record from Serial
    • JP – Device – Add to Group – Mod
  • Permissions: 

    • Read – Mobile Devices
    • Update – Static Mobile Device Groups (for static groups)
Jamf Pro – Module

JP – Device – Add to Group – Mod

Shortcut Download Link (OneDrive)
Shortcut Download Link (iCloud)

Description:
Supports main Shortcut

  • Required Modules

    • N/A
  • Permissions: 

    • Read – Mobile Devices
    • Update – Static Mobile Device Groups (for static groups)
MultipurposeShortcutModule
Jamf Pro – Module

JP – User – Get User record from username

Shortcut Download Link (OneDrive)
Shortcut Download Link (iCloud)

Description:
Supports main Shortcut

  • Required Modules

    • N/A
  • Permissions: 

    • Read – Users
MultipurposeShortcutModule

Learn more about CompNow’s Jamf & Apple Capabilities
Or see the Jamf School Shortcuts below.

Jamf Solutions   Apple Capabilities

Jamf School – Main

JS – QR Scanner 3.1 – Device

Shortcut Download Link (OneDrive)
Shortcut Download Link (iCloud)

Description:
Return Mac or Mobile Device & User information.
*Jamf School does not differentiate between Macs and Mobile Devices

  • Required Modules

    • JS – Get Device Dict from Serial
    • JS – Get User Record from ID
  • Permissions: 

    • None
      Jamf School does not require privileges like Jamf Pro
Jamf School – Module

JS – Get Device Dict from Serial

Shortcut Download Link (OneDrive)
Shortcut Download Link (iCloud)

Description:
Supports main Shortcut

  • Required Modules

    • N/A
  • Permissions: 

    • None
      Jamf School does not require privileges like Jamf Pro
MultipurposeShortcutModule
Jamf School – Module

JS – Get User Record from ID

Shortcut Download Link (OneDrive)
Shortcut Download Link (iCloud)

Description:
Supports main Shortcut

  • Required Modules

    • N/A
  • Permissions: 

    • None
      Jamf School does not require privileges like Jamf Pro
MultipurposeShortcutModule
I am looking to
Check warranty and insurance status

How to find your serial number?