Self Service one click restore 10.13.6

KyleEricson
Valued Contributor II

With 10.13.6 installer there is a way to erase a hard drive and re-install the OS. Can I have in this policy a remove this device record from JAMF so I can use this to decom Macs?

Read My Blog: https://www.ericsontech.com
2 REPLIES 2

wesleya
Contributor

With an API call you certainly could. You might try something like this:

#!/bin/sh

jssURL="https://jss.address.here:8443"
apiUser="username"
apiPass="password"

#Get the serial number
SERIAL_NUMBER=$(system_profiler SPHardwareDataType | grep 'Serial Number (system)' | awk '{print $NF}')

#DELETE the Computer
curl -ks -H "Content-Type: text/xml" 
-u "$apiUser":"$apiPass" "$jssURL"/computers/serialnumber/$SERIAL_NUMBER 
-X DELETE

Something like this should work, but I might consider using the API to move these to a decommissioned site then deleting from there.

gachowski
Valued Contributor II

This should help

https://www.jamf.com/blog/reinstall-a-clean-macos-with-one-button/

C