If you change a computer’s MDM configuration in Apple School Manager (ASM) or Apple Business Manager (ABM) after a computer has already started Setup Assistant, then the computer may be in a state where it is trying to enroll to a previously configured MDM server before you changed it in ASM/ABM. This may result in the computer giving a 500 MDM server connection error when you try to proceed past the “Remote Management” screen in Setup Assistant. Big Sur seems to not try to refresh this cached MDM info once it pulls it down for the first time. Not sure how later macOS versions behave in Setup Assistant. Big Sur and later versions of macOS make it a non-trivial process to delete the MDM cached info. For Big Sur and later do the following to clear out the Setup Assistant cached MDM enrollment settings:
- Boot the computer into Recovery Mode and then start the Terminal app while in Recovery Mode.
- In Terminal run the command: csrutil disable
- Reboot the computer and go into Recovery Mode again and launch the Terminal app.
- Delete the cached MDM enrollment data by running the following command: rm “/Volumes/Hard Drive – Data/private/var/db/ConfigurationProfiles/Settings/.cloudConfigRecordFound”
- Change “Hard Drive – Data” to match the name of the data partition of the computer you are working on. It will be whatever you named the OS hard drive partition with “– Data” appended to the end of the name.
- Run the Terminal command: csrutil enable
- Reboot back into Setup Assistant and the cached MDM settings should now be gone and the computer will pull the latest settings from ASM/ABM again.