Boot to Recovery Mode by holding <code style="background-color: var(--color-neutral-muted);">command-R during restart and continue with Main procedure
disable rebootcsrutil
cd "/Volumes/Macintosh HD/System/Library"
mkdir LaunchDaemons.disabled LaunchAgents.disabled
mv LaunchDaemons/com.apple.ManagedClient* LaunchDaemons.disabled/
mv LaunchAgents/com.apple.ManagedClient* LaunchAgents.disabled/
cd ../../etc
echo "0.0.0.0 iprofiles.apple.com" >> hosts
echo "0.0.0.0 mdmenrollment.apple.com" >> hosts
echo "0.0.0.0 deviceenrollment.apple.com" >> hosts
echo "0.0.0.0 gdmf.apple.com" >> hosts
csrutil enable
reboot
type enrollment Enrolled via DEP: No MDM enrollment: Noprofiles status -
Restart into recovery
csrutil disable
Restart into normal user mode
sudo mount -uw / sudo mkdir /System/Library/LaunchAgentsDisabled sudo mkdir /System/Library/LaunchDaemonsDisabled sudo mv /System/Library/LaunchAgents/com.apple.ManagedClientAgent.agent.plist /System/Library/LaunchAgentsDisabled sudo mv /System/Library/LaunchAgents/com.apple.ManagedClientAgent.enrollagent.plist /System/Library/LaunchAgentsDisabled sudo mv /System/Library/LaunchDaemons/com.apple.ManagedClient.cloudconfigurationd.plist /System/Library/LaunchDaemonsDisabled sudo mv /System/Library/LaunchDaemons/com.apple.ManagedClient.enroll.plist /System/Library/LaunchDaemonsDisabled sudo mv /System/Library/LaunchDaemons/com.apple.ManagedClient.plist /System/Library/LaunchDaemonsDisabled sudo mv /System/Library/LaunchDaemons/com.apple.ManagedClient.startup.plist /System/Library/LaunchDaemonsDisabled
Restart back into recovery
Terminal:
csrutil enable
Restart into normal mode and work like normal.
Source: https://gist.github.com/henrik242/65d26a7deca30bdb9828e183809690bd