Is there a way to remotely wipe Macs either through worklet or script using Automox? Essecially looking for something similar to a factory reset. I found a post for Windows but not Mac.
Thanks for the advice!
Is there a way to remotely wipe Macs either through worklet or script using Automox? Essecially looking for something similar to a factory reset. I found a post for Windows but not Mac.
Thanks for the advice!
I’d imagine this one will require the use of an MDM tool. I wouldn’t think that would be a scriptable thing with Mac, especially if it is already enrolled.
#!/bin/bash
# This will erase all data on your Mac and reinstall macOS
# Unmount disk
diskutil unmountDisk /dev/disk0
# Erase disk
diskutil eraseDisk JHFS+ "Macintosh HD" /dev/disk0
# Reinstall macOS
osascript -e 'tell application "Finder" to activate' -e 'tell application "System Events" to tell process "Finder" to keystroke "d" using {command down, shift down}'
# Inform user
echo "Factory reset complete. Your Mac will now restart and begin the macOS installation process."
this has not been tested.
No account yet? Create an account
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.