progrez.cloud

Disable Device Enrolment Program (DEP) notification on macOS

23 November 2021

With full reinstall (recommended)

  • Boot into recovery using <code style="background-color: var(--color-neutral-muted);">command-R during reboot, wipe the harddrive using Disk Utility, and select reinstall macOS
  • Initial installation will run for approximately 1 hour, and reboot once
  • It will then show a remaining time of about 10-15 minutes
  • When it reboots again, be sure to press <code style="background-color: var(--color-neutral-muted);">command-R to boot into recovery and continue with Main procedure

Without full reinstall

Boot to Recovery Mode by holding <code style="background-color: var(--color-neutral-muted);">command-R during restart and continue with Main procedure

Main procedure

  • Open Utilities → Terminal and type
$ csrutil disable
$ reboot
  • Hold <code style="background-color: var(--color-neutral-muted);">command-R during the reboot to enter Recovery Mode again
  • Enter Disk Utility, and mount the <code style="background-color: var(--color-neutral-muted);">Macintosh HD volume (or whatever your main volume is named). (It might already be mounted.)
  • Exit Disk Utility, open Utilities → Terminal, and type
$ 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
  • If you come to the “Choose your country/location” dialogue, make sure to not select a wireless network, but “continue without an internet connection”
  • After a normal boot, you can verify the DEP status in Terminal:
$ profiles status -type enrollment
Enrolled via DEP: No
MDM enrollment: No


Other Step

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