Laptop Automation

kadams
Contributor

Hello everyone, hope you all are doing well today. I have started a project dealing with laptop automation. I would like to point out that I have never automated anything before. I am now taking on some bigger projects at work and this is one of them. I find myself having to set up many computers for onboardings here. The way I set these up take too much time. I feel like I can be using that time to on other things. Our machines are enrolled in Jamf, and encrypted. Typical laptop setup process involves grabbing the quick add package. After that, I run the sudo jamf policy command in terminal. I can walk away from the computer while that is running. What I would like out of this project is to turn on a computer, run a script and it does everything. For instance, script grabs quickadd package from website. Script runs quickadd package, and runs sudo jamf policy. I also would like something that can quickly wipe/install MAC OS. We have employees who leave the company and we have to backup and wipe computers. I want to do as less manual work as possible. What makes this a difficult task for me is that im less than beginner at Linux and I don't have any devops knowledge. What im able to do is find things online and test them out. I can also slightly edit some scripts depending on complexity.

7 REPLIES 7

walt
Contributor III

DEP + Jamf

https://www.apple.com/business/docs/DEP_Guide.pdf

https://support.apple.com/en-us/HT204142

walt
Contributor III
  • this from Jamf: https://www.jamf.com/blog/reinstall-a-clean-macos-with-one-button/?keywords=eraseinstall

kadams
Contributor

@walt With Apple DEP I can turn on a computer and it'll enroll in jamf? Does the quick add package get run as well as the sudo jamf policy?. Essentially I want to just log into a machine and have it auto do its thing. For instance, log into 6 computers and have them all enroll at once. As for the resintall mac os thing, our machine have different OS's. I can't use this for every computer that we have.

rwinfie
Contributor

@kadams You can use that for all computers since it will just download the current mac OS installer which provides this. As for DEP if your policies are set to run on going or with enrollment complete. once you sign in it will continue to "do all the things "

wmayhone
New Contributor III

I would highly recommend you contact Jamf Support. Let them know what your plans/ideas are, and they can help you start the path.

kadams
Contributor

@rwinfie I will try to do test this out today.

kadams
Contributor

@rwinfie

How it works
After a user or technician clicks the Erase & Install button, the command only takes a few seconds to run and should restart the Mac within 30 seconds. It works by creating a new partition, copying the installer to the new partition, making it bootable and restarting the Mac. After restarting, the installer simply deletes the old partition with all its data, creates a new partition and installs a fresh macOS.

It takes the same amount of time to re-install macOS as if booting from an external drive and significantly less time than booting to the Recovery HD and running macOS Recovery, which downloads a fresh installer at that moment. Consider keeping a copy of the Install macOS High Sierra.app installer on your managed Macs all the time as a means of quickly erasing and re-installing the operating system on demand.

The ‑‑eraseinstall argument does have one caveat. It only works with APFS volumes. That means you can erase and install an existing macOS High Sierra Mac (10.13) that’s already been reformatted to APFS, but you cannot use it to erase and install a macOS Sierra (10.12) or earlier Mac. However, the startosinstall command does support upgrading macOS Sierra and earlier Macs to macOS High Sierra. Upgrading automatically converts HFS+ formatted SSD and flash-based drives to APFS. That command is:

"/Applications/Install macOS High Sierra.app/Contents/Resources/startosinstall" ‑‑applicationpath "/Applications/Install macOS High Sierra.app" ‑‑agreetolicense &