MacOS Mojave Sysprep like script

I was just wondering if anyone knows of a way to do this now? With the release of Mojave Apple has removed Single User Mode. For e.g. Before, you could leave a Shell script on the desktop and access it from Single User Mode, run the script from there and it could seal the mac for an out of box experience. (Like Windows with Sysprep) Is there another way to do this now? Hope this made sense?

cheers

Sure! That is pretty much what MDS does. More along the lines of layered imaging with the install.wim.

Thanks for getting back to me!! Do you think you could give me a bit of direction of how to go about doing the seal script with MDS? Since you now can’t boot to single user mode I am still not sure how you could do it with MDS? So you are saying it’s still possible without single user mode? I know how to use MDS for automatic account creation but after testing it would be great to run a script to have the account that was created removed and the computer to boot for a new user.

thanks again!

P.S. Your site and products are great by the way!

If I am understanding you correctly, you want to log in to macOS, set it up like you want it, then remove the user stuff. You could boot into recovery versus single user, correct?

tim

Hi! Yes I would like to do something like that. More so really logging in to MacOS, testing it and then removing the account and anything that may have been created. Used to do this easily before Mojave in single user mode. Would drop a shell script on the desktop and restart into single user mode. Apple got rid of single user mode in Mojave. So wondering if this is still possible another way? Booting to recovery would be fine as long as the whole OS doesn’t have to be restored again just to bring the computer back to “Out of Box Experience” MDS solved the account creation part. Really saves time.

Hi Tim! Hopefully my reply was clear. Let me know if you have any ideas. Anything will help. I am unable to find the answer anywhere. Thanks for taking the time to respond I know you are a busy man!

I am investigating something similar. Using APFS to “snap back” to a known state. Nothing completed yet, but would allow you to return back to the clean slate.

Thats an excellent idea if that can work. I have messed around with SnapShots myself but not to the extent of trying to snap back to a clean slate. Thanks for the reply!

I’m not familiar with Sysprep, but I’ll share with you my workflow:

Boot into recovery or off of a macOS install drive (I have a partition on my MDS deployment drive with the most current Mojave installer), run MDS-built configuration which:

  1. Installs latest macOS (downloaded via Greg Neagle’s excellent installinstallmacos.py script).
  2. Creates a local administrator account with an ID <500 & hides it (doesn’t show if login is set to display users)
  3. Installs apps (either packages or full apps)
  4. Sets system level preferences/profile

I could just as easily add a “standard” account in addition to the admin account created in step 2 for testing, then delete it via that local admin account.

I’ve found that having a local admin account has saved my sanity more than a few times. And if you want to execute a password change to existing local admin accounts, there’s scripts to do so (just create a package with a post install script and deploy that with your favorite tool).

Tim’s idea of using APFS snapshots sounds interesting, but, for the moment, just execute a script to clean up your temporary account & data, which is what it sounds like you’ve been doing, just from the hidden admin account.

Cheers,
Jon

Thanks for sharing Jon. SysPrep for Windows has more than one function but one of the main ones is to put a computer into a factory sealed state. So for e.g. you can get into SysPrep mode, do some testing add some applications etc and then when done you select to put the computer in “out of box experience” Like you would have purchased it in the store and created an account for the first time. This is the goal for me for Mac. I was able to do this before but now with Mojave you can’t because Apple got rid of Single User Mode in Mojave. Hopefully Tim can figure something out. I fooled around with Snapshots as well but was not able to get it to work. Still trying though. Thanks guys!