Skip to content

Instantly share code, notes, and snippets.

@smashism
Last active July 31, 2023 18:51
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/7da3fd2d460ee654a8ca4be1e4e1ee8a to your computer and use it in GitHub Desktop.
Save smashism/7da3fd2d460ee654a8ca4be1e4e1ee8a to your computer and use it in GitHub Desktop.
Automate marking mobile devices as unmanaged with the Jamf Pro Classic API
#!/bin/bash -x
deviceIDs=(
# put jssIDs here for mobile devices 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/mobiledevices/id/{$id}" -d "<mobile_device><general><managed>false</managed></general></mobile_device>"
done
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment