Skip to main content
Question

Remotely wipe Mac

  • February 20, 2024
  • 2 replies
  • 211 views

Forum|alt.badge.img

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!

jack.smith
Forum|alt.badge.img+1

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. 


Forum|alt.badge.img
  • Novice
  • February 22, 2024

#!/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.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings