Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save xybydy/d8e0a74895730ee45160717482c57979 to your computer and use it in GitHub Desktop.
Save xybydy/d8e0a74895730ee45160717482c57979 to your computer and use it in GitHub Desktop.

Disable Device Enrollment Notification on Mac.md

Restart the Mac in Recovery Mode by holding Comment-R during restart

Open Terminal in the recovery screen and type

csrutil disable

Restart computer

Edit com.apple.ManagedClient.enroll.plist

In the terminal, type

sudo open /Applications/TextEdit.app /System/Library/LaunchDaemons/com.apple.ManagedClient.enroll.plist

change

<key>com.apple.ManagedClient.enroll</key>
        <true/>

to

<key>com.apple.ManagedClient.enroll</key>
        <false/>

Restart Computer again

So that the changes take effect

@xybydy
Copy link
Author

xybydy commented Feb 19, 2020

Just wanted to share my experience with OS Mojave. The Terminal codes didn't end up working for me, and kept getting "file doesn't exist" when trying to move the files via Terminal (maybe I just couldn't figure it out). What did work for me was:

Restart into recovery
Terminal command: csrutil disable
Restart into normal user mode
created folders:
/System/Library/LaunchAgentsDisabled
/System/Library/LaunchDaemonsDisabled
drag and drop (copy) files into /System/Library/LaunchAgentsDisabled:
/System/Library/LaunchAgents/com.apple.ManagedClientAgent.agent.plist
/System/Library/LaunchAgents/com.apple.ManagedClientAgent.enrollagent.plist
drag and drop (copy) files into /System/Library/LaunchDaemonsDisabled:
/System/Library/LaunchDaemons/com.apple.ManagedClient.cloudconfigurationd.plist
/System/Library/LaunchDaemons/com.apple.ManagedClient.enroll.plist
/System/Library/LaunchDaemons/com.apple.ManagedClient.plist
/System/Library/LaunchDaemons/com.apple.ManagedClient.startup.plist
delete files (also delete from trash):
/System/Library/LaunchAgents/com.apple.ManagedClientAgent.agent.plist
/System/Library/LaunchAgents/com.apple.ManagedClientAgent.enrollagent.plist
/System/Library/LaunchDaemons/com.apple.ManagedClient.cloudconfigurationd.plist
/System/Library/LaunchDaemons/com.apple.ManagedClient.enroll.plist
/System/Library/LaunchDaemons/com.apple.ManagedClient.plist
/System/Library/LaunchDaemons/com.apple.ManagedClient.startup.plist
Restart into recovery
Terminal command: csrutil enable
Restart into normal user mode
ALL DONE!!!

@xybydy
Copy link
Author

xybydy commented Mar 28, 2020

notification kaldirma
/System/Library/LaunchAgents/com.apple.ManagedClientAgent.enrollagent.plist /System/Library/LaunchDaemons/com.apple.ManagedClient.enroll.plist

@xybydy
Copy link
Author

xybydy commented Nov 13, 2020

I got this working today on Big Sur. Here are the steps I followed.

Note that after installing the update that came out today (beta 7 I think) I had to redo these steps!

  1. Restart in Recovery Mode (Command+R)
  2. Utilities->Terminal
  3. run command mount

make note of the dev for your root volume - in my case it was /dev/disk3s1 on /Volumes/Macintosh\ HD

  1. umount /Volumes/Macintosh\ HD
  2. mkdir /Volumes/Macintosh\ HD
  3. mount -t apfs -rw /dev/disk3s1 /Volumes/Macintosh\ HD
  4. Move the com.apple.ManagedClient* files out of their normal location
cd /Volumes/Macintosh\ HD/System/Library/LaunchAgents
mkdir tmp
mv com.apple.ManagedClientAgent.* tmp/
mv com.apple.mdmclient.* tmp/
cd ../LaunchDaemons
mkdir tmp
mv com.apple.ManagedClient.* tmp/
mv com.apple.mdmclient.* tmp/
  1. Turn off authenticated-root in csrutil
csrutil authenticated-root disable
  1. Save a snapshot of the currently mounted root filesystem
bless --folder /Volumes/Macintosh\ HD/System/Library/CoreServices --bootefi --create-snapshot
  1. reboot

I also tested/verified what @SonyaLynn mentioned above, that if you turn authenticated-root back on it boots from the unmodified snapshot. I'm also not sure that the order of number 8 and 9 matter - the main thing I noticed is that you have to have the filesystem in read+write in order to bless the new snapshot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment