Skip to content

Instantly share code, notes, and snippets.

@sghiassy
Last active September 12, 2024 19:52
Show Gist options
  • Save sghiassy/a3927405cf4ffe81242f4ecb01c382ac to your computer and use it in GitHub Desktop.
Save sghiassy/a3927405cf4ffe81242f4ecb01c382ac 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

@spoved-aws
Copy link

Hi, I have been using my Intel 2019 MBP since 2020 with the host blocked. Im still on ventura. I recently ran a script to see if my Mac was still under MDM. I got the results that it was not on a MDM server. I thought that maybe this was because I had the hosts blocked, I removed the host entry and ran the test again with the same result. I have now had the Mac running 24 hours without the hosts blocked and not received any pop up messages. Is it possible that my Mac has been released from MDM? How can I tell for sure before updating to Sonoma ? Thank you script. https://github.com/rtrouton/rtrouton_scripts/tree/main/rtrouton_scripts/check_mdm_enrollment

No, the script is only checking on the local system if the mdm profile is installed or not.

@sqig
Copy link

sqig commented Jun 8, 2024

I have used a paid online MDM check and my Mac is still enrolled.
Model: MacBook Pro (15-inch, 2018) Space Gray Wi-Fi [A1989] [MacBookPro15,1]
Serial Number: C02XXXXXXX
MDM Lock: ON
Thank you

@Ran-Xing
Copy link

Ran-Xing commented Jun 8, 2024

@sqig I can provide technical support for a fee.

@charlvin
Copy link

Install Sequoia developer Beta, risking DEP

I am thinking if I should install Sequoia directly through Sonoma. It works perfectly now without DEP notification.

`charlvin@LCWMacBook-Pro ~ % sudo profiles status -type enrollment

Enrolled via DEP: No
MDM enrollment: No`

@hoorrus
Copy link

hoorrus commented Jun 11, 2024

FWIW, I had the following FQDNs blocked at the router:

iprofiles.apple.com mdmenrollment.apple.com deviceenrollment.apple.com gdmf.apple.com acmdm.apple.com albert.apple.com

I had them blocked in /etc/hosts as well. Still was able to update. Based on a quick search, gdmf.apple.com is specifically for MDM-managed devices.

Here is a list of all the FQDNs for the various services Apple devices might use

I have an unmanaged iMac and a used-to-be-managed Macbook Pro on my home network. My employer sends out alerts when there are major MacOS updates, critical updates, & patches. When the 14.4 notice came out, I went in to Software Update on both systems, and the 14.4 update showed up automagically as expected. No unblocking on my part.

If you truly do HAVE to unblock gdmf.apple.com to get updates, your machine may actually still be enrolled, but some other step in one of the techniques here suppresses the nag messages.

To check that, open Terminal and enter the following command:

profiles status -type enrollment

Your results should be :

Enrolled via DEP: No
MDM enrollment: No

@PaxVobiscuit, Hi, have you or anyone else had issues updating OS after this?

@JediRhymeTrix
Copy link

Is the Sequoia public beta safe? I had bypassed DEP on Monterey and am currently running Sonoma 14.5 with zero issues. Is it worth giving the Sequoia beta a try?

@rplus1
Copy link

rplus1 commented Jul 26, 2024

It looks like skipmdm.com is now a paid service. When copying and pasting the line from website into terminal in recovery, I receive this message:

Detected serial number: [serial #]
Error: This scrip tis not authorized for this device.
Contact Telegram @skip_mdm or WhatApps [phone #] to make a payment for that Serial

Is this service still legit?

@sam09h
Copy link

sam09h commented Jul 27, 2024

Hi everyone. I updated to Sonoma 14.5 From Monterey yesterday and after installing I got a pop up saying remote management but just hit skip now and worked fine after. Today I tried using it and now the same pop up comes up taking over my whole screen without a “skip now” button. I tried everything on here but nothing has allowed me to use the Sudo codes in terminal in regular mode because the pop up comes up within 10 seconds of booting up Everytime. I don’t want to erase the MacBook because I have a lot of data on it I need.
Any help would be great. I am able to go into recovery mode find but that’s about it. Thank you!

try turning off ur wifi if the pop up still comes. delete all the wifi passwords saved on ur mac. After several tries it worked for me

which codes did you put into terminal? what exact steps did you follow. i appreciate your help

Disabling DEP and MDM on macOS

  1. Cut the Wi-Fi

    • Disable your Wi-Fi to ensure your Mac has no internet connection and avoid the pop-up during the process.
  2. Turn Off the Mac

    • Shut down your Mac completely.
  3. Boot into Recovery Mode

    • Turn on your Mac and immediately hold down Command-R to boot into Recovery Mode.
  4. Disable SIP (System Integrity Protection)

    • Once in Recovery Mode, open the Utilities menu and select Terminal.
    • In the Terminal window, type the following command to disable SIP:
      csrutil disable
      
  5. Additional Steps in Recovery Mode

    • Run the following commands to manage Configuration Profiles and cloud records:

      launchctl disable system/com.apple.ManagedClient.enroll
      rm -rf /var/db/ConfigurationProfiles/Settings/.cloudConfigHasActivationRecord
      rm -rf /var/db/ConfigurationProfiles/Settings/.cloudConfigRecordFound
      touch /var/db/ConfigurationProfiles/Settings/.cloudConfigProfileInstalled
      touch /var/db/ConfigurationProfiles/Settings/.cloudConfigRecordNotFound
      rm -rf /Volumes/Macintosh\ HD/var/db/ConfigurationProfiles/Settings/.cloudConfigHasActivationRecord
      rm -rf /Volumes/Macintosh\ HD/var/db/ConfigurationProfiles/Settings/.cloudConfigRecordFound
      touch /Volumes/Macintosh\ HD/var/db/ConfigurationProfiles/Settings/.cloudConfigProfileInstalled
      touch /Volumes/Macintosh\ HD/var/db/ConfigurationProfiles/Settings/.cloudConfigRecordNotFound
      
    • Restart your Mac by typing:

      reboot
      
    • Note: If the files under /var/db/ are not present, removing them might not be necessary. However, adding the touched files helps ensure completeness.

  6. Grant Terminal Full Disk Access

    • Once your Mac has restarted normally, go to System Preferences > Security & Privacy > Privacy tab.
    • Select Full Disk Access from the left sidebar.
    • Click the lock icon to make changes, and add Terminal to the list of applications allowed Full Disk Access.
  7. Modify the Hosts File

    • Open Terminal and enter the following commands to block the necessary Apple servers:
      sudo /bin/sh -c 'echo "0.0.0.0 iprofiles.apple.com" >> /etc/hosts'
      sudo /bin/sh -c 'echo "0.0.0.0 mdmenrollment.apple.com" >> /etc/hosts'
      sudo /bin/sh -c 'echo "0.0.0.0 deviceenrollment.apple.com" >> /etc/hosts'
      sudo /bin/sh -c 'echo "0.0.0.0 gdmf.apple.com" >> /etc/hosts'
      
  8. Verify Hosts File Modification

    • Check if the hosts file has been updated correctly by running:
      sudo nano /etc/hosts
      
    • Ensure the lines you added are present.
  9. (Optional) Re-enable SIP

    • If you want to re-enable SIP, reboot your Mac into Recovery Mode again (Command-R).
    • Open Terminal in Recovery Mode and type:
      csrutil enable
      
    • Restart your Mac by typing:
      reboot
      
  10. Verify DEP and MDM Status

    • After a normal boot, open Terminal and run the following command to check the DEP and MDM enrollment status:
      profiles status -type enrollment
      
    • The output should show:
      Enrolled via DEP: No
      MDM enrollment: No
      
  11. Reconnect to Wi-Fi

    • Once everything is verified, you can safely reconnect your Mac to Wi-Fi.

@MikeParder
Copy link

Is the Sequoia public beta safe? I had bypassed DEP on Monterey and am currently running Sonoma 14.5 with zero issues. Is it worth giving the Sequoia beta a try?

Did you ever try upgrading?

@spoved-aws
Copy link

Hi everyone. I updated to Sonoma 14.5 From Monterey yesterday and after installing I got a pop up saying remote management but just hit skip now and worked fine after. Today I tried using it and now the same pop up comes up taking over my whole screen without a “skip now” button. I tried everything on here but nothing has allowed me to use the Sudo codes in terminal in regular mode because the pop up comes up within 10 seconds of booting up Everytime. I don’t want to erase the MacBook because I have a lot of data on it I need.
Any help would be great. I am able to go into recovery mode find but that’s about it. Thank you!

try turning off ur wifi if the pop up still comes. delete all the wifi passwords saved on ur mac. After several tries it worked for me

which codes did you put into terminal? what exact steps did you follow. i appreciate your help

Disabling DEP and MDM on macOS

  1. Cut the Wi-Fi

    • Disable your Wi-Fi to ensure your Mac has no internet connection and avoid the pop-up during the process.
  2. Turn Off the Mac

    • Shut down your Mac completely.
  3. Boot into Recovery Mode

    • Turn on your Mac and immediately hold down Command-R to boot into Recovery Mode.
  4. Disable SIP (System Integrity Protection)

    • Once in Recovery Mode, open the Utilities menu and select Terminal.
    • In the Terminal window, type the following command to disable SIP:
      csrutil disable
      
  5. Additional Steps in Recovery Mode

    • Run the following commands to manage Configuration Profiles and cloud records:
      launchctl disable system/com.apple.ManagedClient.enroll
      rm -rf /var/db/ConfigurationProfiles/Settings/.cloudConfigHasActivationRecord
      rm -rf /var/db/ConfigurationProfiles/Settings/.cloudConfigRecordFound
      touch /var/db/ConfigurationProfiles/Settings/.cloudConfigProfileInstalled
      touch /var/db/ConfigurationProfiles/Settings/.cloudConfigRecordNotFound
      rm -rf /Volumes/Macintosh\ HD/var/db/ConfigurationProfiles/Settings/.cloudConfigHasActivationRecord
      rm -rf /Volumes/Macintosh\ HD/var/db/ConfigurationProfiles/Settings/.cloudConfigRecordFound
      touch /Volumes/Macintosh\ HD/var/db/ConfigurationProfiles/Settings/.cloudConfigProfileInstalled
      touch /Volumes/Macintosh\ HD/var/db/ConfigurationProfiles/Settings/.cloudConfigRecordNotFound
      
    • Restart your Mac by typing:
      reboot
      
    • Note: If the files under /var/db/ are not present, removing them might not be necessary. However, adding the touched files helps ensure completeness.
  6. Grant Terminal Full Disk Access

    • Once your Mac has restarted normally, go to System Preferences > Security & Privacy > Privacy tab.
    • Select Full Disk Access from the left sidebar.
    • Click the lock icon to make changes, and add Terminal to the list of applications allowed Full Disk Access.
  7. Modify the Hosts File

    • Open Terminal and enter the following commands to block the necessary Apple servers:
      sudo /bin/sh -c 'echo "0.0.0.0 iprofiles.apple.com" >> /etc/hosts'
      sudo /bin/sh -c 'echo "0.0.0.0 mdmenrollment.apple.com" >> /etc/hosts'
      sudo /bin/sh -c 'echo "0.0.0.0 deviceenrollment.apple.com" >> /etc/hosts'
      sudo /bin/sh -c 'echo "0.0.0.0 gdmf.apple.com" >> /etc/hosts'
      
  8. Verify Hosts File Modification

    • Check if the hosts file has been updated correctly by running:
      sudo nano /etc/hosts
      
    • Ensure the lines you added are present.
  9. (Optional) Re-enable SIP

    • If you want to re-enable SIP, reboot your Mac into Recovery Mode again (Command-R).
    • Open Terminal in Recovery Mode and type:
      csrutil enable
      
    • Restart your Mac by typing:
      reboot
      
  10. Verify DEP and MDM Status

    • After a normal boot, open Terminal and run the following command to check the DEP and MDM enrollment status:
      profiles status -type enrollment
      
    • The output should show:
      Enrolled via DEP: No
      MDM enrollment: No
      
  11. Reconnect to Wi-Fi

    • Once everything is verified, you can safely reconnect your Mac to Wi-Fi.

Hello, thanks for the details. Would you know how to disable the pop-up for Profiles wants to make change? I have already bypassed the mdm with these steps last year and for the last 4-6 months I have started getting the annoying pop up of Profiles wants to make changes. Any way to disable that?

image

@guiga1502
Copy link

Hi, can anyone confirm if it works on Sonoma 14.6? Is it safe to update?

@Sam-0908
Copy link

Hi everyone. I updated to Sonoma 14.5 From Monterey yesterday and after installing I got a pop up saying remote management but just hit skip now and worked fine after. Today I tried using it and now the same pop up comes up taking over my whole screen without a “skip now” button. I tried everything on here but nothing has allowed me to use the Sudo codes in terminal in regular mode because the pop up comes up within 10 seconds of booting up Everytime. I don’t want to erase the MacBook because I have a lot of data on it I need.
Any help would be great. I am able to go into recovery mode find but that’s about it. Thank you!

try turning off ur wifi if the pop up still comes. delete all the wifi passwords saved on ur mac. After several tries it worked for me

which codes did you put into terminal? what exact steps did you follow. i appreciate your help

Disabling DEP and MDM on macOS

  1. Cut the Wi-Fi

    • Disable your Wi-Fi to ensure your Mac has no internet connection and avoid the pop-up during the process.
  2. Turn Off the Mac

    • Shut down your Mac completely.
  3. Boot into Recovery Mode

    • Turn on your Mac and immediately hold down Command-R to boot into Recovery Mode.
  4. Disable SIP (System Integrity Protection)

    • Once in Recovery Mode, open the Utilities menu and select Terminal.
    • In the Terminal window, type the following command to disable SIP:
      csrutil disable
      
  5. Additional Steps in Recovery Mode

    • Run the following commands to manage Configuration Profiles and cloud records:
      launchctl disable system/com.apple.ManagedClient.enroll
      rm -rf /var/db/ConfigurationProfiles/Settings/.cloudConfigHasActivationRecord
      rm -rf /var/db/ConfigurationProfiles/Settings/.cloudConfigRecordFound
      touch /var/db/ConfigurationProfiles/Settings/.cloudConfigProfileInstalled
      touch /var/db/ConfigurationProfiles/Settings/.cloudConfigRecordNotFound
      rm -rf /Volumes/Macintosh\ HD/var/db/ConfigurationProfiles/Settings/.cloudConfigHasActivationRecord
      rm -rf /Volumes/Macintosh\ HD/var/db/ConfigurationProfiles/Settings/.cloudConfigRecordFound
      touch /Volumes/Macintosh\ HD/var/db/ConfigurationProfiles/Settings/.cloudConfigProfileInstalled
      touch /Volumes/Macintosh\ HD/var/db/ConfigurationProfiles/Settings/.cloudConfigRecordNotFound
      
    • Restart your Mac by typing:
      reboot
      
    • Note: If the files under /var/db/ are not present, removing them might not be necessary. However, adding the touched files helps ensure completeness.
  6. Grant Terminal Full Disk Access

    • Once your Mac has restarted normally, go to System Preferences > Security & Privacy > Privacy tab.
    • Select Full Disk Access from the left sidebar.
    • Click the lock icon to make changes, and add Terminal to the list of applications allowed Full Disk Access.
  7. Modify the Hosts File

    • Open Terminal and enter the following commands to block the necessary Apple servers:
      sudo /bin/sh -c 'echo "0.0.0.0 iprofiles.apple.com" >> /etc/hosts'
      sudo /bin/sh -c 'echo "0.0.0.0 mdmenrollment.apple.com" >> /etc/hosts'
      sudo /bin/sh -c 'echo "0.0.0.0 deviceenrollment.apple.com" >> /etc/hosts'
      sudo /bin/sh -c 'echo "0.0.0.0 gdmf.apple.com" >> /etc/hosts'
      
  8. Verify Hosts File Modification

    • Check if the hosts file has been updated correctly by running:
      sudo nano /etc/hosts
      
    • Ensure the lines you added are present.
  9. (Optional) Re-enable SIP

    • If you want to re-enable SIP, reboot your Mac into Recovery Mode again (Command-R).
    • Open Terminal in Recovery Mode and type:
      csrutil enable
      
    • Restart your Mac by typing:
      reboot
      
  10. Verify DEP and MDM Status

    • After a normal boot, open Terminal and run the following command to check the DEP and MDM enrollment status:
      profiles status -type enrollment
      
    • The output should show:
      Enrolled via DEP: No
      MDM enrollment: No
      
  11. Reconnect to Wi-Fi

    • Once everything is verified, you can safely reconnect your Mac to Wi-Fi.

Hello, thanks for the details. Would you know how to disable the pop-up for Profiles wants to make change? I have already bypassed the mdm with these steps last year and for the last 4-6 months I have started getting the annoying pop up of Profiles wants to make changes. Any way to disable that?

image

Try to disconnect the WiFi and remove all WiFi preferences and saved connection.

@spoved-aws
Copy link

spoved-aws commented Jul 30, 2024

@Sam-0908 , I turned off the wifi , went to advanced section of wifi and cleared all Wifi connections I had there. For some time the pop-up did not come and I was like wow, that was the issue and I tried opening some apps ( which is generally when the pop up comes ) like parallels, chrome etc. The pop up did not come. Then I opened another app called Goodnotes and the popup came back again.

Is there anything else I should be deleting than just the saved connections ? I do not understand what you mean by remove Wifi preferences.

@TomRider22
Copy link

TomRider22 commented Jul 30, 2024

@spoved-aws

@Sam-0908 , I turned off the wifi , went to advanced section of wifi and cleared all Wifi connections I had there. For some time the pop-up did not come and I was like wow, that was the issue and I tried opening some apps ( which is generally when the pop up comes ) like parallels, chrome etc. The pop up did not come. Then I opened another app called Goodnotes and the popup came back again.

Is there anything else I should be deleting than just the saved connections ? I do not understand what you mean by remove Wifi preferences.

If you see a pop-up that means that you are not disabled the mdm mechanism. Try to login into recovery mode and repeat all the steps that sam09h mentioned above. Verify DEP and MDM Status. Also, before that check the Profiles menu in System Settings and remove profiles if they will be there.
2024-07-30 20-06-06

@spoved-aws
Copy link

yep it was the xfinity hotspot profile causing the issues. For the last 6 months I was thinking it was MDM. thanks everyone for their help

@spoved-aws
Copy link

Hi, can anyone confirm if it works on Sonoma 14.6? Is it safe to update?

yes, all good.

@guiga1502
Copy link

Hi, can anyone confirm if it works on Sonoma 14.6? Is it safe to update?

yes, all good.

Thanks, works fine!
I hope that in version 15 everything will still work.

@sam09h
Copy link

sam09h commented Aug 2, 2024

Hi, can anyone confirm if it works on Sonoma 14.6? Is it safe to update?

yes, all good.

Thanks, works fine! I hope that in version 15 everything will still work.

Im on 15.4 beta everything works fine

@luuucho
Copy link

luuucho commented Aug 4, 2024

Hello everyone, stupidly I booted Ventura recently (I was in Ventura to Sonoma when the MDM pop up comes originally), so i'm not able to disable csrutil cause the administration profile, what can I do?, at the moment of the installation a pop up asks me for a Wifi connection, and should I boot installing Sonoma and try the workaround or should I stay in Ventura?

Thank's y'all for the collaboration to the problem! Rango bless you.

@nizarmeziane
Copy link

Is the Sequoia public beta safe? I had bypassed DEP on Monterey and am currently running Sonoma 14.5 with zero issues. Is it worth giving the Sequoia beta a try?

Hello, I did the update from Sonoma 14.0 to Sequoia Beta 15.0 and it works fine (I had 0.0.0.0 for Apple Urls in /etc/hosts already set up).
No Pop-up is shown on the new OS.

@SocoMacman289
Copy link

Well boys, I am this close to giving up. I did the 0.0.0.0 for Apple Urls in /etc/hosts, did the profile cong fig commands, checked everything with nano to see if what I what typing was working and it was… Used Sonoma today for a cool 5 hours. It was awesome. Having universal control, continuity camera, and the lock screen refresh on my mid 2015 mbp was awesome. I then started to get a little worried, the full screen prompt started coming up, but it was just the square outline of it. There is actually no text or anything. It would be glitch and go away. I thought to myself, wow, I actually did this. The commands that I typed in terminal are blocking MDM. Well, sad to say I got the full screen prompt and I cannot even get around it in safe mode. This will be the fourth time that I try this but the only thing that I did not try yet was the very first comment on this thread. I did try it when I was not in recovery mode, but it said I did not have permissions to write this File. So now I will try to properly do it in recovery mode, but I’m starting to lose all hope. My next plan of action is to call the company that my Mac is on, but I doubt that will work as my Mac is almost 10 years old. I bought this off at Amazon thinking it was brand new, but I was sadly mistaken.

@skaza2125
Copy link

I dont get the pop up but I wanted to remove those files in /var/db anyway, and I could not do it. It says operation not permitted and errors. ls -al shows this:

drwxr-xr-x 4 root wheel 128 Aug 4 03:31 . drwxr-xr-x 114 root wheel 3648 Aug 16 01:24 .. drwxr-xr-x@ 9 root wheel 288 Aug 16 01:28 Settings

@Sam-0908
Copy link

@Sam-0908 , I turned off the wifi , went to advanced section of wifi and cleared all Wifi connections I had there. For some time the pop-up did not come and I was like wow, that was the issue and I tried opening some apps ( which is generally when the pop up comes ) like parallels, chrome etc. The pop up did not come. Then I opened another app called Goodnotes and the popup came back again.

Is there anything else I should be deleting than just the saved connections ? I do not understand what you mean by remove Wifi preferences.

I meant remove saved networks and WiFi passwords that are saved on your Mac

@joaopedropio
Copy link

Hi, guys. The Company I work is selling some Mac mini M1 but they said It's "locked". I suspect that It's this mdm Lock. Does these steps work on a Mac mini?

@Ran-Xing
Copy link

yes, try! @joaopedropio

@Mktulio
Copy link

Mktulio commented Aug 22, 2024

Yes! I bought one at the OLX sales market, I didn't know and when I formatted it I got this surprise. I solved it with this post. Oh! After solving don't format, just sign out of icloud, open a new user and delete the old one.

@joaopedropio
Copy link

Ok, this is the actual screen of the Mac Mini
image
I'm afraid that this machine has no way of fixing it.

@Reinaaperra
Copy link

Hey guys,

I ran the skipmdm - back in September last year to upgrade to Sonoma 14.0. I’ve had no issues with the enrolment popping back up at all. However I’ve never updated since. If I update it to Sonoma 14.6.1, will the enrolment messages start popping back up again? Is it worth the risk and is the update really necessary?

@Aooga776
Copy link

Hey guys,

I ran the skipmdm - back in September last year to upgrade to Sonoma 14.0. I’ve had no issues with the enrolment popping back up at all. However I’ve never updated since. If I update it to Sonoma 14.6.1, will the enrolment messages start popping back up again? Is it worth the risk and is the update really necessary?

So I'm on Ventura 13.0 and have been since I got this M1 out of the box. Before Sequoia comes out I'm going to try and upgrade to Sonoma tomorrow with the directions in this thread. I really really really hope it works.

@Sam-0908
Copy link

Hey guys,
I ran the skipmdm - back in September last year to upgrade to Sonoma 14.0. I’ve had no issues with the enrolment popping back up at all. However I’ve never updated since. If I update it to Sonoma 14.6.1, will the enrolment messages start popping back up again? Is it worth the risk and is the update really necessary?
No risk you can update.

So I'm on Ventura 13.0 and have been since I got this M1 out of the box. Before Sequoia comes out I'm going to try and upgrade to Sonoma tomorrow with the directions in this thread. I really really really hope it works.

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