Policy to erase disk and reinstall macOS

AJPinto
Honored Contributor II

Good morning folks,

I am working on a policy that will erase macOS and all user data on the disk and reinstall. So far I have everything working pretty nicely however it does not erase the local admin accounts directory. Not erasing this directory is causing problems as this account is the only local account on the machine since we use mobile accounts for general users. Figuring I am missing something pretty simple, any ideas?

Below is the command I am running with the policy.

/Applications/Install macOS Catalina.app/Contents/Resources/startosinstall --eraseinstall --agreetolicense --forcequitapps --newvolumename 'Macintosh HD'

1 REPLY 1

anickless
Contributor II

this is what I am using in a script

!/bin/bash

/Applications/Install macOS Catalina.app/Contents/Resources/startosinstall --eraseinstall --agreetolicense --forcequitapps --newvolumename 'Macintosh HD'
exit 0;