Skip to content

Instantly share code, notes, and snippets.

@smashism
Created July 31, 2023 18:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save smashism/4a60d1bbe1f38ee1cb0c5dd724108b71 to your computer and use it in GitHub Desktop.
Save smashism/4a60d1bbe1f38ee1cb0c5dd724108b71 to your computer and use it in GitHub Desktop.
Automate marking computers as unmanaged with the Jamf Pro Classic API
#!/bin/bash -x
deviceIDs=(
# put jssIDs here for computers to remove
# ex. 12345678
0000
)
for id in "${deviceIDs[@]}"; do
/usr/bin/curl -sku "apiuser":"apipass" -X PUT -H "content-type: text/xml" "https://yourjamfpro.jamfcloud.com/JSSResource/computers/id/{$id}" -d "<computer><general><remote_management><managed>false</managed></remote_management></general></computer>"
done
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment