Triggering a policy off of an Erase Content & Settings event

macservit
New Contributor III

Playing around with Erase Content & Settings (EC&S) on a Monterey test machine and hit a small snag. I have a policy in place consisting of a script that prompts the user to input the asset tag number located on the bottom of the machine. Once that value is known, the script uses it along with a few other tidbits to change HostName, ComputerName, and LocalHostName accordingly. The policy trigger is currently set to Enrollment Complete (and the script stays in a Sleep loop until the Dock process starts). It works great with a fully wiped machine that is new to or previously deleted from Jamf.

The issue is that the device is retained by Jamf after EC&S, including the Asset Tag value, but the various computer/host names are reset to default. I need to find a way to fire the script after an EC&S event. I could change the trigger to Recurring Check-in and re-write the script to compare the values between Asset Tag and the computer names and run if they don't contain the those asset characters, but I'm a pretty weak scripter and that seems like a ton of work. Could I leverage the Custom Event trigger to fire the Policy and script when a computer is wiped?

0 REPLIES 0