Trigger DEP on a MacOS machine after installation

Ever wondered how to trigger a Mac to pull a DEP profile without rebuilding the whole machine? This is something I thought was totally impossible despite lots of searching. Then one day, I ran across this thread in Reddit and it's possible!

Someone just casually mentioned that you can do this with the following command:

sudo profiles renew -type enrollment

Sure enough it works perfectly? How was I not able to find this all this time? Jees... you'd think there would be a good way to search the internet or something.

While I'm at it, here is another neat trick to re-trigger a Mac to act as if it's been newly started up without having to fully wipe it first.

sudo rm /var/db/.AppleSetupDone 
sudo rm -rf /var/db/ConfigurationProfiles/ 
sudo rm /Library/Keychains/apsd.keychain

Reboot the machine and re-enroll. You may find that you are not allowed to run the 2nd or 3rd command due to permissions, but just doing the first one should be good enough.

No comments:

Post a comment