Skip to content

Instantly share code, notes, and snippets.

@sghiassy
Last active December 4, 2024 10:13
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

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.

@Aooga776
Copy link

First, let me get off my chest, that skipmdm.com now seems to be scammy to me. It is not free as every post and video I watched eluded to. They want $30 or $50 to add your serial number to their list. Not sure how protected you need to keep your serial number, but I wasn't giving them that info or paying them for a simple script. SO with that, I just updated from Ventura 13.0 to Sonoma 14.6.1 via software update.

You have to have Wifi on when you go through the update prompts before the restart. After fully updated, I was on the login screen. From there, I followed the steps below by booting into recovery mode. I turned off the WiFi in recovery mode. I ran all of the commands below. The only errors I got were with:

 touch /Volumes/Macintosh\ HD/var/db/ConfigurationProfiles/Settings/.cloudConfigProfileInstalled
 touch /Volumes/Macintosh\ HD/var/db/ConfigurationProfiles/Settings/.cloudConfigRecordNotFound

After restarting, I logged in to my account and everything was fine. No pop-ups, didn't even go through the hello screens and all of those.

Now fingers crossed it works for Sequoia next week. Someone wanna be that guinea pig? HAHA!

Thanks so much to everyone who helped out on this post. Appreciate you all!

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.

@spoved-aws
Copy link

anyone updated to Sequoia? I tried from the App Store but it would pop up the update in settings.

Can you jump from 14.6 --> 15 ( Seq ) ? or do I need to be on 14.6.1 first?

@ParkerPerry
Copy link

First, let me get off my chest, that skipmdm.com now seems to be scammy to me. It is not free as every post and video I watched eluded to. They want $30 or $50 to add your serial number to their list. Not sure how protected you need to keep your serial number, but I wasn't giving them that info or paying them for a simple script. SO with that, I just updated from Ventura 13.0 to Sonoma 14.6.1 via software update.

You have to have Wifi on when you go through the update prompts before the restart. After fully updated, I was on the login screen. From there, I followed the steps below by booting into recovery mode. I turned off the WiFi in recovery mode. I ran all of the commands below. The only errors I got were with:

 touch /Volumes/Macintosh\ HD/var/db/ConfigurationProfiles/Settings/.cloudConfigProfileInstalled
 touch /Volumes/Macintosh\ HD/var/db/ConfigurationProfiles/Settings/.cloudConfigRecordNotFound

After restarting, I logged in to my account and everything was fine. No pop-ups, didn't even go through the hello screens and all of those.

Now fingers crossed it works for Sequoia next week. Someone wanna be that guinea pig? HAHA!

Thanks so much to everyone who helped out on this post. Appreciate you all!

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.

I havent checked in a really long time to actually use skipmdm again but you shouldn't have to pay for it. You just use the website to copy the script and paste it:

"
curl -# https://raw.githubusercontent.com/skip-m/m/main/MChip -o file && chmod 777 ./file && ./file
"

Not really sure what aspect you are seeing that makes you think its been moved under a pay wall

@Reinaaperra
Copy link

First, let me get off my chest, that skipmdm.com now seems to be scammy to me. It is not free as every post and video I watched eluded to. They want $30 or $50 to add your serial number to their list. Not sure how protected you need to keep your serial number, but I wasn't giving them that info or paying them for a simple script. SO with that, I just updated from Ventura 13.0 to Sonoma 14.6.1 via software update.

You have to have Wifi on when you go through the update prompts before the restart. After fully updated, I was on the login screen. From there, I followed the steps below by booting into recovery mode. I turned off the WiFi in recovery mode. I ran all of the commands below. The only errors I got were with:

 touch /Volumes/Macintosh\ HD/var/db/ConfigurationProfiles/Settings/.cloudConfigProfileInstalled
 touch /Volumes/Macintosh\ HD/var/db/ConfigurationProfiles/Settings/.cloudConfigRecordNotFound

After restarting, I logged in to my account and everything was fine. No pop-ups, didn't even go through the hello screens and all of those.

Now fingers crossed it works for Sequoia next week. Someone wanna be that guinea pig? HAHA!

Thanks so much to everyone who helped out on this post. Appreciate you all!

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.

When I used it last year I didn’t pay anything or give them a serial code (you probably did come across a scam).

I just copied and pasted the script. I initially had an issue with it because it had an error so I messaged the person on telegram they told me what the issue was and how to fix it (my Macintosh hard drive had another name so I had to input that).

I’ve had no issues since but I’ve just not updated the OS since. I came here to ask if anyone else who ran the same script has done an update since running the script and if anyone has had the pop up come up so I can know before hand.

@pain0x0
Copy link

pain0x0 commented Sep 17, 2024

has any updated to 15? im on 14, haven't updated since lol

@ehsan58
Copy link

ehsan58 commented Sep 17, 2024

is there any update about sequoia? anyone updated from 14.6 to 15?

@guiga1502
Copy link

has any updated to 15? im on 14, haven't updated since lol
is there any update about sequoia? anyone updated from 14.6 to 15?

I did the update yesterday. So far so good, I haven't received any warnings and everything seems to be working fine.

@pain0x0
Copy link

pain0x0 commented Sep 18, 2024

has any updated to 15? im on 14, haven't updated since lol
is there any update about sequoia? anyone updated from 14.6 to 15?

I did the update yesterday. So far so good, I haven't received any warnings and everything seems to be working fine.

good to hear, what did you update from? im still on 14.0, never updated, was scared to.

@Mktulio
Copy link

Mktulio commented Sep 19, 2024

Atualizei para o Sequoia tudo ok.

@itzcharlie01
Copy link

Atualizei para o Sequoia tudo ok.

Então você está dizendo que depois da atualização você não precisou executar comandos para fazê-lo funcionar, simplesmente funcionou?

@guiga1502
Copy link

has any updated to 15? im on 14, haven't updated since lol
is there any update about sequoia? anyone updated from 14.6 to 15?

I did the update yesterday. So far so good, I haven't received any warnings and everything seems to be working fine.

good to hear, what did you update from? im still on 14.0, never updated, was scared to.

I upgraded from 14.6 to 15.0. Working fine.

Atualizei para o Sequoia tudo ok.

Então você está dizendo que depois da atualização você não precisou executar comandos para fazê-lo funcionar, simplesmente funcionou?

If you have already run the commands previously in version 14.x, during the migration to 15.0 it was normal. You do not need to run it again.

@AngelCrum
Copy link

image Hi, I did have a problem, I updated and now I only get the registration alert in the configuration. I've done everything, from changing and blocking the host, to re-patching. I don't know what else I can do or what I'm doing wrong. I hope someone can help me.

THANK YOU.

@Mktulio
Copy link

Mktulio commented Sep 26, 2024

Atualizei para o Sequoia tudo ok.

Então você está dizendo que depois da atualização você não precisou executar comandos para fazê-lo funcionar, simplesmente funcionou?

yes!

@andreas-bulling
Copy link

The Workaround
(1) Disable SIP in 1 True Recovery
(2)
sudo rm /var/db/ConfigurationProfiles/Settings/.cloudConfigHasActivationRecord
sudo rm /var/db/ConfigurationProfiles/Settings/.cloudConfigRecordFound
sudo touch /var/db/ConfigurationProfiles/Settings/.cloudConfigProfileInstalled
sudo touch /var/db/ConfigurationProfiles/Settings/.cloudConfigRecordNotFound
(3) you're all set. enjoy this boring upgrade

What is "1 True recovery" and how can I access it? Does intel Macs have a "1 True recovery" too?

do yourself a favor and use opencore on top of mac boot rom. change the SN in opencore instead of patching the OS

in this case one only has to fake the serial numbers and all should be good, i.e. no file removing etc needed - do I understand you correctly?

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