Posted on 02-06-2023 11:41 AM
We're using erase-install v.28.1 and in testing so far it's been great, really enjoying the new script and swift GUI. I want to know if anyone else has used this or something similar in conjunction with a terminal command to delete the machine calling the script from Jamf.
In this use case, the machine in question has a Self Service button to initiate a Factory Wipe, and we would like to call --postinstall-command that essentially runs: sudo jamf delete_computer ID=XXX where the machine we're running the command from is the one in question. I've tested a few 1 line commands in " "s and they work, but I've not tried including a small script inside yet. Unless there is an already easy way to show the machine's ID in a single line, I figured it would have to be nested in a small script, I just haven't put down the time yet to test, curious if anyone else has already done this or something similar.
Solved! Go to Solution.
Posted on 02-06-2023 07:15 PM
@Jon_L erase-install has two options that you would find appropriate for triggering your deletion script: --preinstall-command and --postinstall-command. They are triggered immediately before and just after startosinstall runs respectively (see https://github.com/grahampugh/erase-install/wiki/4.-Upgrading-macOS#--preinstall-command for more details)
Posted on 02-06-2023 12:12 PM
@Jon_L There isn't a jamf binary verb named delete_computer so it'd need more than a simple terminal command. You would have to use script to call the Jamf API to do the deletion, and I don't think you're going to fit that into a script parameter for erase-install. You could call another Jamf Pro policy to run a deletion script from your erase-install script though.
Posted on 02-07-2023 10:41 AM
This is the way
02-06-2023 01:34 PM - edited 02-06-2023 01:35 PM
Thanks for the quick clarification @sdagley we'll give that a shot :D (probably set it to run the delete script before it kicks off the wipe script so we'll make sure to cache it beforehand.)
Initially, we thought to call a policy/script when the erase-install policy is completed, but it does not report back completed when it actually wipes the machine :)
Posted on 02-06-2023 07:15 PM
@Jon_L erase-install has two options that you would find appropriate for triggering your deletion script: --preinstall-command and --postinstall-command. They are triggered immediately before and just after startosinstall runs respectively (see https://github.com/grahampugh/erase-install/wiki/4.-Upgrading-macOS#--preinstall-command for more details)
Posted on 02-13-2023 06:44 AM
I'd be interested in your solution as well. We have a ton of devices that seem to get device signature errors after using the erase and install.sh script. Jamf's suggestion was to delete the ID of the device.