221

Disable Device Enrollment Notification on Mac.md

 1 year ago
source link: https://gist.github.com/sghiassy/a3927405cf4ffe81242f4ecb01c382ac
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

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/>
<key>com.apple.ManagedClient.enroll</key>
        <false/>

Restart Computer again

So that the changes take effect

secured2k commented on Mar 11

Try following the steps in the posts from Nov. 24, 2020 and newer - the instructions to boot into recovery mode are not needed. Editing plist files on an APFS signed boot partition also generally won't work without breaking some other functionality such as full disk encryption.

@secured2k I have read and re-read the messages > 24/11 but it is still confusing and at the end I still get the MDM popups. Can you confirm again what are the only necessary steps for this to work?
My hosts file has the following lines
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
0.0.0.0 iprofiles.apple.com
0.0.0.0 mdmenrollment.apple.com
0.0.0.0 deviceenrollment.apple.com
0.0.0.0 gdmf.apple.com
Is that ok?
I also ran the command "profiles remove -all"

secured2k commented on Mar 13

edited

make sure you run profiles remove -all with sudo
sudo profiles remove -all

Then reboot without the option to reopen windows when you reboot. Optionally you can boot to safe mode and back to normal mode.
How To: Safe Mode: https://support.apple.com/en-us/HT201262

If you include gdmf.apple.com in your hosts file, you will not get updates. My hosts file only contains

127.0.0.1 deviceenrollment.apple.com
127.0.0.1 mdmenrollment.apple.com
127.0.0.1 iprofiles.apple.com

Once closing the pop up and attempting sudo profiles remove -all, and rebooting a few times, the pop up has not appeared in over a year and the system tested is in the Dev test pool and regularly gets all updates (including the current 12.3 Monterey 12E230). This is expected as without working network connectivity to Apple servers, the system does not know there is a profile to show an alert.

A recent reply in a forked thread suggests including 1 more site, but I have not had to do this and no one else seems to have replied in mass saying this is required. However, here is the site also reported to need to be blocked: acmdm.apple.com (added to hosts or blocked via other firewall method).

Thank you very much @secured2k, I appreciate. Now it is more clear but I still have 3 questions.

1/ I see that you use 127.0.0.1 instead of 0.0.0.0. Is it better? Is it necessary to change?

2/ If I have to remove and add a line in the hosts file, how do I do that as it is read only? In secure mode, the terminal does not give me any command to edit the file. I managed to add these lines previously with echo command.

3/ When I had to install a clean Monterey on my apple-chip MBP, I had to create a bootable USB drive with the installer. If I boot with the USB drive, is there an option to edit the hosts file that way?

secured2k commented on Mar 13

edited
  1. It should not matter; You do not need to change it.
    0.0.0.0 might be better because the system would interpret it as a completely invalid non-routable address while 127.0.0.1 would have connections back to the local host loopback thus getting a reply, socket closed. If I was actually running a web service hosted on my machine and it was bound to the adapter, programs would actually hit my own web server when using 127.0.0.1/8.

  2. There is an "easy" console text editor included in MacOS called "nano". In order to modify a system-wide configuration file in /etc, you will need Administrative permissions (root). You gain this access with the sudo command. For example,
    sudo nano /etc/hosts
    Use the arrow keys and keyboard to edit the file, press CTRL+X to exit, press Y and then [ENTER] to Save when prompted.

  3. Theoretically Yes, but I have not tested or checked on what protections (if any) are done during the setup process. I also do not have any recent Mac to test on. Editing the hosts file may be similar but the mount paths are likely to be different; you may need to manually mount data volumes. In Install/Recovery mode, you are already root, so sudo is not needed; I am unsure is nano is included. Worst case would be to use vi instead.

I don't know how to thank you to take so much time to reply to my (and others') many questions!
Now that everything is clear, I will report if it worked.

arnonate commented on Mar 14

edited

Hello, I have been through this thread back and forth and have tried as many options as possible. My scenario, I have erased my HD multiple times and tried reinstalling the OS with all suggestions above and still get the Managed screen on OS setup. When I make changes to the hosts file or the file structure and reboot, then all changes I made are gone. I can see them before the reboot, but not after. I have a 2019 MBP, not M1.

secured2k commented on Mar 14

The instructions for the main post are for Catalina and outdated. For updated current instructions for Big Sur and newer, please review the comments since Nov 24, 2020.

Summary: The easiest way to stop the alerts is to block network access to the Apple servers that report your Mac’s serial number is managed. Even after blocking the servers, some alerts may still appear for some time until specific commands or reboots are done. See the most recent posts for others going through the same issue.

arnonate commented on Mar 14

@secured2k I get all of that, what I guess I am missing is.... Are these instructions for people with admin access and a running OS to remove notifications ONLY or will these help me restore a MacBook with MDM, which is what I am trying to do.

secured2k commented on Mar 14

The comments explain the issue is a company has reported owner ship and management over a serialized device. There is no way to remove that management without original proof of ownership or the original enrollment company’s action. The main purpose here is for those who may have acquired a Mac from a second hand dealer (Amazon, eBay) and not have the options to remove MDM. In which case it is assumed the new owner has physical access to the hardware and can wipe/restore/has admin access to the machine and wants the initial enrollment step to be bypassed or the reminder notifications to stop.

@arnonate I had exactly the same problem as you are encountering. I was desperate... but at the end it worked.
I installed the new os monterey from a usb flashdrive. Before starting the MBP 2017 (same as yours), I turned off the wifi in the house. Then I got the admin mdm screen you are talking about. You have to say MANY times that you have no internet. I had to confirm at least 7-8 times then mdm gave up and installed the os normally. Hope this help.

@secured2k After editing the hosts file again (removing and adding a line), running sudo profiles remove -all, and finally restarting without any window open... it seems that the annoing popup does not come so often. It came only once in 2 days... maybe its last breath!

@secured2k Unfortunately, the popup is still showing a few times a day!

secured2k commented on Mar 16

There are multiple past posters that have used the same methods with success. There may be a typo or error or special case with your system. If you would like, I can take a look using a tool like AnyDesk after day business hours.

@secured2k I would appreciate that. I am in Namibia UTC+02:00. You can reach at paul AT paulgodard.com. Thank you.

Kups-newb commented on Mar 21

16478963978307906181298609355167

@secured2k tried this but still getting notification. Any advice please?

secured2k commented on Mar 22

I have no other advice than what has already been posted since Mid 2020 (more so since Nov 24, 2020) as well as the past 2 weeks.
There are many that are not having issues, so unless I am able to see or reproduce an issue, I cannot recommend additional actions.

I will explain a simplified explanation of the alert. When MacOS Starts up, it is told to load certain programs; some which are responsible for management features like DEP.

/usr/libexec/cloudconfigurationd will try to get the profile from iprofiles.apple.com via TLS. (Possibly other servers in the block list)
If the profile is accepted, the ManagedClient.app is used to retrieve more data and perform additional installation / configuration.
/System/Library/CoreServices/ManagedClient.app/Contents/Resources/ManagedClientAgent
/System/Library/CoreServices/ManagedClient.app/Contents/MacOS/ManagedClient

For those who are running a system and getting alerts, some of these programs are started and will continue to try to reach Apple servers and find the serial number is in their MDM list thus showing a pop-up using Apples APN (Apple Push Notification) services or some other OS notification method.

If the connections are truly blocked, once any notifications are delivered and dismissed, they should not come back.

Kups-newb commented on Mar 22

I see. Thank you for your time @secured2k appreciate your time responding to my query.

SoSho96 commented on Apr 11

edited

Hi, I have zero coding experience, except occasionally searching posts like these and following the steps/copying code into a terminal, usually with some success. From everything I've read here, the first post with specific instructions to disable Device Enrollment will only work in OS Catalina and below. I've since downgraded from Big Sur to Catalina cause I don't really need Big Sur (i.e. done a complete re-install of the system, wiped hard drive and installed from a bootable USB. These steps were easy and successful), and left the computer off-line, with no access to the internet.

My issue is that I get stuck on the second step. Every time I enter sudo open /Applications/TextEdit.app /System/Library/LaunchDaemons/com.apple.ManagedClient.enroll.plist into the terminal, it comes up with this message: The file /Applications/TextEdit.app does not exist

What's going on? I can see in the finder that Text Edit is very much alive and well in the applications folder. Help? @secured2k any thoughts?

eduardo1510 commented on Apr 11

edited

I tried a free bypass through iremove.tools and it seems to be working on newest MACOS. Just follow the steps. It works on T2 and M1 from what I read on their website

https://iremove.tools/remove-device-management-on-macbook

agent4tea7 commented 22 days ago

edited

@stephenjason89 - I have upgraded since High Sierra to each new MacOS release. I have written many notes on how to get things working to disable to DEP notifications. Many of the instructions are modifications of my original instructions or from other users providing an alternative method of network access control. The Pros and Cons have been discussed and tested. There is not much different in this area of security with the new system. Please review the thread around the release time of the betas for a lot more detail.

The easiest method is blocking 3 hosts in the hosts file or using some kind of firewall software (pf) or hardware (router) to block the hosts via IPs and/or DNS lookups. There are special cases for fresh (re)-installs. Activation Lock is not bypassed.

**127.0.0.1 deviceenrollment.apple.com
127.0.0.1 mdmenrollment.apple.com
127.0.0.1 iprofiles.apple.com**

As for daily use, I am constantly using different technology and what I find is the changes to UI or methods are usually small changes that you just have to get used to... by now I'm used to it. As with every release, I do find the UI a little slower as more data/code is being processed. This isn't an issue with newer hardware, but my old Mac is getting up there in years.

Hi, I am on Monterey 12.3.1 on MBP M1 2020 with device supplied with MDM-DEP. I bypassed the DEP and have been using the system for a few days now with occasional DEP notification. I have added domains above to my host, except I used 0.0.0.0 as prefix should I be using my local host as prefix instead of 0.0.0.0? - DEP notifications haven't completely disappeared for me. My csrutil is disabled.

i too have this problem on my mac air 2020 i5. tried placing those 0.0.0.0 lines in etc/hosts .but still its same. how to get rid of this, pls help me this pop up is annoying always !!

Is it 0.0.0.0 you used or your local host as your prefix? - I am sensing you've to use your local host i.e. 127.0.0.1 instead of 0.0.0.0, not sure though. I am on MBP M1 2020, Monterey 12.3.1. and notifications do pop up sometime still. You found a fix?

I tried a free bypass through iremove.tools and it seems to be working on newest MACOS. Just follow the steps. It works on T2 and M1 from what I read on their website

https://iremove.tools/remove-device-management-on-macbook

The above software did not work on macbook pro with Monterey. The DEP notifications still come up several times a day.

I tried a free bypass through iremove.tools and it seems to be working on newest MACOS. Just follow the steps. It works on T2 and M1 from what I read on their website
https://iremove.tools/remove-device-management-on-macbook

The above software did not work on macbook pro with Monterey. The DEP notifications still come up several times a day.

Are you following the steps as mentioned? The no wifi methods activating and also turning your router off and also the terminal step while in the recovery options? Crucial steps

I tried a free bypass through iremove.tools and it seems to be working on newest MACOS. Just follow the steps. It works on T2 and M1 from what I read on their website
https://iremove.tools/remove-device-management-on-macbook

The above software did not work on macbook pro with Monterey. The DEP notifications still come up several times a day.

For me it is not so much the MDM screen that is the problem, I bypassed that without Wifi and installed MacOS off internet and that's worked. It's just the DEP notification that pops up every now and again that I cannot get rid of. Tried the 0.0.0.0 in host but I wonder if I need to actually type in my local host and not just 0.0.0.0

The textedit.app hack doesn't work for me, not only the files are in different locations for me, but my terminal keeps prompting that textedit.app does not exist roll_eyes

DEP notifications no longer appear if the profile site(s) are blocked. A typo or extra space could cause the site(s) not to be blocked.
I have previously posted instructions and answers to all questions recently asked; please check for some recent answers with the easiest repairs starting as far back as Nov 2020.

Short Summary:
0.0.0.0 should work (technically better) than 127.0.0.1; but the end result is the same.
Use nano for a console text editor.

If anyone needs additional help, I have previously posted a Session ID that will reach my MacOS system. We can work out remote control and I can check or explain the issue. If one can afford it, a donation/tip would be appreciated. So far, 1 person who offered to pay never did (but I did say it was optional), another person just asked for details in chat, and the 3rd person got in touch via email but we never worked out any remote support; possibly due to busy schedules and time zone differences.

Hello secured2k
have you had any experience with iremove? How reliable is this software?

I have no experience with iRemove.tools. Since I'm more of low level "do it yourself" tech, I have not investigated or tried other potential options. I am not interested in testing it because this is not a revenue generating model for me. I looked over the instructions and it looks like it just does the same thing posted in this thread. Basically wipe the Mac and disable network access. Then it wants to disable SIP so maybe it's installing its own firewalling/filtering driver or modifying other system files. Since I don't have a problem with the 1 second-hand Mac that has this MDM Enrollment problem, I will probably not try to reverse engineer what it is doing.

I think there was only 1 review where someone said it worked for them; perhaps the payment is enough for normal users who are not IT trained to work in CLI or with low level OS design, security, or programming methods.

heck the thread for instructions since Nov 25 2020. There are no new changes to the process since then, including the answers to your question. The original instructions should be considered out of date. If you want more information, check posts I’ve made since June 2020 in the thread.

If you wish to leave a private message, you can try Session messenger with this ID: 0517092fbb16bb2ae1e169c2984154d5e80c9096f9109aa248f71705ed64313e1e

sam09h commented 22 days ago

@secured2k thank you very much for your time and help

brunerd commented yesterday

Here's a way to get around DEP that doesn't require blocking network hosts

## these commands MUST be from Terminal in Recovery mode only (as root of course)
## this assumes the boot drive is named "Macintosh HD" and is a newer OS that has a Data volume
## you may need to open Disk Utility to mount the Data volume then open Terminal

#clear the nvram if there is any saved WiFi info there
nvram -c

#remove the known networks plist which auto-joins your WiFi - older version of macOS may not have this
rm /Volumes/Macintosh\ HD\ -\ Data/Library/Preferences/com.apple.wifi.known-networks.plist 

#the WiFi password IS still stored here but it is not necessary to remove this
rm /Library/Keychains/System.keychain

#SUPPRESS FOR SETUP ASSISTANT ONLY
#remove all the dot files .* in Settings the main file is .cloudConfigHasActivationRecord
rm /Volumes/Macintosh\ HD\ -\ Data/private/var/db/ConfigurationProfiles/Settings/.*
#When you reboot with this method you must choose Other for network options then "This Mac does not connect to the Internet" to skip Remote Management
#this method of skipping via Other/No Internet is usually sufficient for macOS 10.14 and under

#SUPPRESS PERMANENTLY
#remove the entire folder and it NEVER asks for DEP again, without this folder it won't work
rm -r /Volumes/Macintosh\ HD\ -\ Data/private/var/db/ConfigurationProfiles/Settings

reboot

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


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK