Skip to content

Instantly share code, notes, and snippets.

@vbnin
vbnin / delete_offline_protect_computers.sh
Created May 27, 2025 10:40
Delete offline Mac endpoints from Jamf Protect
#!/bin/bash
# This example Bash script below does the following:
# - Obtains an access token.
# - Completes a listComputers query request that returns a list of computers offline since a date defined in input parameters
# - Asks for confirmation
# - Delete offline computers
# Keep the following in mind when using this script:
# - You must define the PROTECT_INSTANCE_PREFIX, CLIENT_ID, and PASSWORD variables to match your Jamf Protect environment. The PROTECT_INSTANCE_PREFIX variable is your tenant name (e.g., your-tenant), which is included in your tenant URL (e.g., https://your-tenant.protect.jamfcloud.com).