Skip to content

Instantly share code, notes, and snippets.

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

@aniop
Copy link

aniop commented Dec 14, 2023

Apple business said that not having a MDM server should not cause this error, but it did, so I am interested in knowing if anyone has allowed their system to update to 14.1 as well and had issues or not had issues...

@aniop said its "save", but I'd love to hear if others had. I really do wanna update, unless someone wants to take one for the team idk

@pain0x0 I've upgraded to 14.2 and it's totally fine

@ehsan58
Copy link

ehsan58 commented Dec 14, 2023

Apple business said that not having a MDM server should not cause this error, but it did, so I am interested in knowing if anyone has allowed their system to update to 14.1 as well and had issues or not had issues...

@aniop said its "save", but I'd love to hear if others had. I really do wanna update, unless someone wants to take one for the team idk

@pain0x0 I've upgraded to 14.2 and it's totally fine

u did with direct update? from 14? or?

@Mktulio
Copy link

Mktulio commented Dec 15, 2023

Apple business said that not having a MDM server should not cause this error, but it did, so I am interested in knowing if anyone has allowed their system to update to 14.1 as well and had issues or not had issues...

@aniop said its "save", but I'd love to hear if others had. I really do wanna update, unless someone wants to take one for the team idk

@pain0x0 I've upgraded to 14.2 and it's totally fine

u did with direct update? from 14? or?

I would also like to know. Help!

@transactionfraud
Copy link

transactionfraud commented Dec 18, 2023

skipmdm.com just worked for me on a 2018 intel mac mini. I updated from mac os 14.1 to 14.2 and after logging in was locked down by the MDM screen.

  1. in recovery mode you go to disk utility, unmount the disk. Rename it to 'Macintosh HD'. Mount your disk again.
  2. go to safari in recovery mode, go to skipmdm.com, click the copy button on the page
  3. go to terminal, in recovery mode, paste. press the option to run (i forgot I think it was 1)
  4. reboot.

@Acelogic
Copy link

Another link to block out in hosts file is, some laptops use that as a fall back to initiate the MDM stuff

0.0.0.0 https://i.manage.microsoft.com/DeviceGatewayProxy/ioshandler.ashx?Platform=MacMDM

@nerykell
Copy link

Hi! I've been struggling with MDM quite a lot and found the easiest, but a little long solution to the problem, but you won't get mdm blocking and profile upload notifications. I have described as much detail as possible for different cases, so find your own and follow the instructions.
I'll tell you the pros and cons at the very end, and now let's move on to the beginning:

Preparatory Stages:

If you are on macOS Ventura or Monterey and you have no problems with MDM, then download this utility https://checkm8.info/bypass-mac-mdm-lock and make a Bypass (this is a precautionary measure, without doing this, I cannot guarantee you a successful system update), if you have already done this before, then immediately proceed to the main stages.

If you are on macOS Ventura or Monterey or Sonoma and you did not turn off the Internet during installation, then the MacBook will download the corporate profile and be blocked. In this case, there are 2 possible scenarios ->

Scenario 1: If your data is not on the computer, then feel free to format the disk and install Monterey/Ventura without the Internet, as soon as you have created a user and configured a MacBook, you can connect to the Internet and bypass MDM using this utility https://checkm8.info/bypass-mac-mdm-lock once you have bypassed MDM with this utility, you can proceed to the main stages.
Scenario 2: If you had Monterey/Ventura and received a lock after upgrading to Sonoma, then the data can still be saved if there was still +-100gb of free space on the disk or if you have an external hard drive

If you still have disk space and you need to restore data from a system blocked by your corporate profile, then follow these steps:

Turn off your MacBook
Reboot into recovery mode by pressing the touch id button
Go to Settings
Disk utility
Divide your disk into 2 independent containers, it is important to note that we do not add a VOLUME for the disk, namely a CONTAINER
Install Monterey/Ventura without internet in a new, empty container and bypass MDM using this utility https://checkm8.info/bypass-mac-mdm-lock
Now in the Finder, find your other user from another container and transfer all the files of interest from the old disk container to the new one
You can proceed to the main stages
If you have an external hard drive and you need to recover data from a locked corporate system profile, then follow these steps:

Install Monterey/Ventura without internet and bypass MDM using this utility https://checkm8.info/bypass-mac-mdm-lock
Now find your other user in the Finder and transfer all the files of interest from the internal drive to the external hard drive
You can proceed to the main stages
The main steps:

So, in order to upgrade to Sonoma without problems, we need an external SSD or HDD (we will save our backup copy of all data via time machine to it)
Using the disk utility, format the external hard drive in APFS and in the settings in the main section select Time Machine, and in it select your external hard drive and then create a backup copy of all data
As soon as the backup is created (you don't have to worry about data security, time machine saves literally everything you can), turn off your MacBook
Enter recovery mode by pressing the touch id button.
Disk utility
Format your internal drive
(Pre-create a bootable USB flash drive with macOS Sonoma) Start installing Sonoma without the Internet, configure your MacBook until you are prompted to transfer data from a time machine backup, select this item
Restore all data from the backup and then complete the installation
That's it, you don't need to do anything else, successful bypass!
The advantages of my method:

Personally tested by me on a macbook pro 13" m1 and has been tested without any problems for a week now
An easy way to bypass the regular macos methods
Do you need more advantages besides reliability and simplicity? :)
Minuses:
Quite a long time

@Signore74
Copy link

Signore74 commented Dec 27, 2023 via email

@ParkerPerry
Copy link

I mean you're completely wrong but okay.

Im literally on Sonoma and this whole forum is specifically about Sonoma. Theres plenty of detailed instructions here so if you cannot figure it out dont deter other people from the solution while spreading incorrect information like its not possible on Sonoma because it clearly is.

@nerykell
Copy link

Has anyone tried this on a native Sonoma M3 macbook? Seems all the recommendations to date apply to Ventura (or older) upgrades. I've been working through every aspect of these recommendations I can but cannot get past the security block on Sonoma.

https://www.youtube.com/watch?v=YjKxz9kxnHE

I think this is the only solution for native Sonoma MacBook

@Signore74
Copy link

Signore74 commented Dec 27, 2023 via email

@ParkerPerry
Copy link

ParkerPerry commented Dec 27, 2023

Factually incorrect. Im on Sonoma and have been since October, got the mdm popup a few days after updating and was getting the full screen notification popup that was locking me out of my computer only a few minutes after rebooting.

Came here and did research and read all of the comments and its been working flawlessly since. No notifications whatsoever, currently on 14.1.1

Screenshot 2023-12-27 at 3 36 30 PM

@ParkerPerry
Copy link

ParkerPerry commented Dec 28, 2023

Factually incorrect. Im on Sonoma and have been since October, got the mdm popup a few days after updating and was getting the full screen notification popup that was locking me out of my computer only a few minutes after rebooting.
Came here and did research and read all of the comments and its been working flawlessly since. No notifications whatsoever, currently on 14.1.1
Screenshot 2023-12-27 at 3 36 30 PM

You say you've "been on Sonoma" - did you upgrade or is your Macbook native Sonoma? There is a difference. Many of us have gotten these instructions to work on an upgraded MB. I can't find anyone who can confirm they have gotten it to work on A) a native Sonoma macbook (IE one delivered with Sonoma, not an earlier OS) and specifically B) an M3 Sonoma laptop.

I updated to Sonoma from Ventura. I fail to see how the process would be any different regardless of what OS your laptop natively ships with. Also why would the m3 be any different than an m1 or m2. MDM has essentially nothing to do with the arm chip itself and is more about the underlying os than any hardware specifics.

The process should be the same regardless, and skipmdm should help if you are running into the mdm notification locking you out straight out of bootup.

Blocking the computer from ports that are pinging apple servers to check if your motherboard is registered as a mdm device seems to be the most important component which has been outlined before.

From my understanding the native os and m series chip you have shouldnt matter. The only difference that people should come across:

  1. Your device doesnt have a mdm profile installed on it but the computer is registered as a mdm device thus you are getting notification popups telling you that your device needs to be registered.

  2. Your device currently has a mdm profile installed on it and is being monitored which probably requires you to do a fresh install and you will need to disconnect your internet upon completing installation. This might not be needed with skipmdm though. I initially had to do this to wipe my corporate laptop and remove the mdm profile from it so I wasnt blocked out of it from my company without a admin account.

Are you able to login as a user on this laptop?

@ideal2545
Copy link

ideal2545 commented Dec 28, 2023 via email

@ParkerPerry
Copy link

@sonomaccess

Well thats why, this forum is specifically for the #1 I mentioned which is regarding just the notification popups and not removing a mdm profile from your device. Im completely aware that you cannot downgrade OS's unfortunately:/

From my experience I was informed a few yrs ago that upgrading from Monterey to Ventura they fixed it to where you can no longer fresh install a new/same os from a usb drive or ote without connecting to the internet for authentication. On Monterey when I did it you just installed the os ote and upon bootup after the installation you disconnected your router which wouldnt let it authenticate on apple servers. I thought they fixed this in Ventura but there seems to be people here who were able to do it still on Ventura.

Im sure its possible but without a device that has a t2 chip on it Im not really sure I can personally test it out but here are two resources that I suggest:

This helped me ages ago remove the mdm profile from my computer: https://support.addigy.com/hc/en-us/articles/4405907255827-Removing-non-removable-MDMs-by-disabling-SIP

More importantly take a look at the last comment by @nerykell here: https://gist.github.com/henrik242/65d26a7deca30bdb9828e183809690bd

@spoved-aws
Copy link

I am on Sonoma 14.2.1

What steps are currently valid to disable the MDM popup ?
I ran csrutil disable in recovery.

sudo csrutil status   
System Integrity Protection status: disabled.

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

and it would not open the file in text edit so I ran
sudo open /System/Applications/TextEdit.app /System/Library/LaunchDaemons/com.apple.ManagedClient.enroll.plist --> this only open the TextEdit app so I navigated to the file I got this error.
image

@macquarrie-joe
Copy link

Have an Intel based Mac I'd bought for my daughter in college and realised it has MDM on it. I'm wondering what latest version of macOS Sonoma folks have had success using? (14.0, 14..1.1, 14.1.2? 14.2, 14.2.1?) And if someone has a streamlined set of instructions or video to watch? I think, I'm going to book into Recovery now from Ventura 13.6.3 usb, disconnect from network with about 1min left, reboot into recovery - open terminal csrutil disable - then from recovery mode open safari and go to skipmdm, copy script, and run in terminal again. Fingers crossed if that's not correct - let me know! Cheers!

@Mktulio
Copy link

Mktulio commented Jan 4, 2024

Tenho um Mac baseado em Intel que comprei para minha filha na faculdade e percebi que tem MDM nele. Estou me perguntando qual versão mais recente do macOS Sonoma as pessoas tiveram sucesso usando? (14.0, 14..1.1, 14.1.2? 14.2, 14.2.1?) E se alguém tiver um conjunto simplificado de instruções ou vídeo para assistir? Acho que vou reservar para a Recuperação agora do Ventura 13.6.3 usb, desconectar da rede com cerca de 1 minuto restante, reiniciar para a recuperação - abrir o terminal csrutil desativar - depois do modo de recuperação abrir o safari e ir para skipmdm, copiar script e executar no terminal novamente. Dedos cruzados se isso não estiver correto - me avise! Saúde -- Fiz exatamente isso! O meu esta na versão 14.0 ( Numca mais apareceu msg MDM, desde novembro de 2023) não pretendo atualizar até ter certeza de algum processo que resolva, pois utilizo meu MacBook para trabalhar.

@HAndresM
Copy link

HAndresM commented Jan 5, 2024

image

@HAndresM
Copy link

HAndresM commented Jan 5, 2024

Greetings,

Suddenly you can help me skip the remote administration of my macbook, I have watched some videos and read the comments but what I tried does not work I always get this message, I don't know much about code, can someone help me.

@Mktulio
Copy link

Mktulio commented Jan 5, 2024

Se você seguir o que foi informado no primeiro poste dará certo. Fiz no meu, estava utilizando o ventura, dai atualizei e esta bem até hoje.

@Signore74
Copy link

Factually incorrect. Im on Sonoma and have been since October, got the mdm popup a few days after updating and was getting the full screen notification popup that was locking me out of my computer only a few minutes after rebooting.
Came here and did research and read all of the comments and its been working flawlessly since. No notifications whatsoever, currently on 14.1.1
Screenshot 2023-12-27 at 3 36 30 PM

You say you've "been on Sonoma" - did you upgrade or is your Macbook native Sonoma? There is a difference. Many of us have gotten these instructions to work on an upgraded MB. I can't find anyone who can confirm they have gotten it to work on A) a native Sonoma macbook (IE one delivered with Sonoma, not an earlier OS) and specifically B) an M3 Sonoma laptop.

I updated to Sonoma from Ventura. I fail to see how the process would be any different regardless of what OS your laptop natively ships with. Also why would the m3 be any different than an m1 or m2. MDM has essentially nothing to do with the arm chip itself and is more about the underlying os than any hardware specifics.

The process should be the same regardless, and skipmdm should help if you are running into the mdm notification locking you out straight out of bootup.

Blocking the computer from ports that are pinging apple servers to check if your motherboard is registered as a mdm device seems to be the most important component which has been outlined before.

From my understanding the native os and m series chip you have shouldnt matter. The only difference that people should come across:

  1. Your device doesnt have a mdm profile installed on it but the computer is registered as a mdm device thus you are getting notification popups telling you that your device needs to be registered.
  2. Your device currently has a mdm profile installed on it and is being monitored which probably requires you to do a fresh install and you will need to disconnect your internet upon completing installation. This might not be needed with skipmdm though. I initially had to do this to wipe my corporate laptop and remove the mdm profile from it so I wasnt blocked out of it from my company without a admin account.

Are you able to login as a user on this laptop?

Bypassing MDM is 100% no longer possible. Apple forces all computers on Sonoma to check in with Apple Business/School Manager to see if a device is owned by an org. If it is owned, it forces the device to check in with the MDM. It doesn't matter if you made it past setup.

@Signore74
Copy link

Bypassing MDM is 100% no longer possible. Apple forces all computers on Sonoma to check in with Apple Business/School Manager to see if a device is owned by an org. If it is owned, it forces the device to check in with the MDM. It doesn't matter if you made it past setup.

No matter how hard you try it won’t work ,this is a new thing Apple is doing now
You better stay on the Ventura OSX ,on Ventura it will work for sure but not on Sonama

@DarkMoron
Copy link

Factually incorrect. Im on Sonoma and have been since October, got the mdm popup a few days after updating and was getting the full screen notification popup that was locking me out of my computer only a few minutes after rebooting.

Came here and did research and read all of the comments and its been working flawlessly since. No notifications whatsoever, currently on 14.1.1

Screenshot 2023-12-27 at 3 36 30 PM

can you please to the specific comment solution which worked for you? Was it any of the MDM bypass scripts that worked for you?

@philipp-winterle
Copy link

For all those people telling wrong facts:

I updated to 14.2.1 for about 1h and got the MDM Registration menu point in settings and I realized it reseted my "hack". So reboot > csrutil disable > reboot >deleting the configs folder > creating Settings and the 2 files in it > reboot > csrutil enable > no MDM anymore

.. I mean until next big update.So @Signore74 stop talking bullshit.

@Mktulio
Copy link

Mktulio commented Jan 12, 2024

Para todas aquelas pessoas que estão contando fatos errados: > > Atualizei para 14.2.1 por cerca de 1h e consegui o ponto de menu de Registro MDM nas configurações e percebi que ele redefiniu meu "hack". Então reinicie > csrutil desativar > reiniciar > excluindo a pasta de configurações > criando Configurações e os 2 arquivos nela > reiniciar > csrutil habilitar > não há mais MDM > > .. Quero dizer, até a próxima grande atualização. Então@Signore74pare de falar besteira. // Que bom @philipp-winterle, farei hoje a noite é retorno aqui com meu resultado.

@varsh8th
Copy link

For all those people telling wrong facts:

I updated to 14.2.1 for about 1h and got the MDM Registration menu point in settings and I realized it reseted my "hack". So reboot > csrutil disable > reboot >deleting the configs folder > creating Settings and the 2 files in it > reboot > csrutil enable > no MDM anymore

.. I mean until next big update.So @Signore74 stop talking bullshit.

Yeah I'm on 14.1.1 and there's no issues on sonoma since a month at least, don't get all the fear mongering on updates.

Also @philipp-winterle , just to confirm when you update to 14.2.1, there's no data loss ? Just do mdm bypass steps and all your data is in tact ?

I updated to sonoma by fresh install w skipmdm method, so wanted to check how the process was without fresh install. I don't plan on updating anytime soon but wanted to know in case of any future updates, that without fresh install if the skip mdm still works :)

@superkwn
Copy link

Does the script from skipMDM still work? I got error message saying "could not find disk for disk1". It seems that the script could not find the disk.
$_12

@superkwn
Copy link

@HAndresM, have you found a solution with skipMDM? I have the same issue as yours.

@ParkerPerry
Copy link

@HAndresM, have you found a solution with skipMDM? I have the same issue as yours.

@superkwn This problem has been documented and explained above. I get it the thread is long but its because your disc drive isnt named "Macintosh HD" I believe.

Someone explained that the skipMDM code is written kinda shitty and doesnt work dynamically as it should and fails if your hard disk isnt the default name. Someone commented on how they changed the skipmdm code to fix this oversight

@superkwn
Copy link

@HAndresM, have you found a solution with skipMDM? I have the same issue as yours.

@superkwn This problem has been documented and explained above. I get it the thread is long but its because your disc drive isnt named "Macintosh HD" I believe.

Someone explained that the skipMDM code is written kinda shitty and doesnt work dynamically as it should and fails if your hard disk isnt the default name. Someone commented on how they changed the skipmdm code to fix this oversight

@ParkerPerry, I need to look into it. But I did the restore using Apple Configurator. I thought the disc drive should be named as "Macintosh HD" in the restore process.

@ParkerPerry
Copy link

I am now getting this error while running the script IMG_2891 I have also run the csrdisable command Anyone seen this?

The script is buggy. It does not recognize the volume where your Mac OS has been installed. It assumes you have a default installation with volumes mounted with their default names, such as "Volumes/Macintosh HD". I have seen installations where the "Macintosh HD" is NOT the name of the volume. Thus, this script would fail miserably. The author would tell you to wipe all your data and reinstall the OS instead of making the script smarter... bad bad.

Here is a command that will tell you the name of your boot volume:

diskutil info -plist "$(bless --getBoot)" |
  plutil -extract VolumeName raw -- -

If this command returns anything other than "Macitonsh HD" then the script is likely going to throw errors.

PM me if you need help getting this MDM check disabled.

@donkelonio Was the one who made the post I remembered seeing. Hope it helps

@superkwn
Copy link

Here is what happened after running script from skipMDM
IMG_8409

@ParkerPerry
Copy link

Here is what happened after running script from skipMDM IMG_8409

What exactly is not working? It seems like it worked imo

@superkwn
Copy link

Here is what happened after running script from skipMDM IMG_8409

What exactly is not working? It seems like it worked imo

The script did not find the correct directory. After reboot, the system is still at the setup page.

@philipp-winterle
Copy link

Also @philipp-winterle , just to confirm when you update to 14.2.1, there's no data loss ? Just do mdm bypass steps and all your data is in tact ?

Can confirm. Your user folders ain't touched

@rcarlosnyc
Copy link

Para todas aquelas pessoas que estão contando fatos errados: > > Atualizei para 14.2.1 por cerca de 1h e consegui o ponto de menu de Registro MDM nas configurações e percebi que ele redefiniu meu "hack". Então reinicie > csrutil desativar > reiniciar > excluindo a pasta de configurações > criando Configurações e os 2 arquivos nela > reiniciar > csrutil habilitar > não há mais MDM > > .. Quero dizer, até a próxima grande atualização. Então@Signore74pare de falar besteira. // Que bom @philipp-winterle, farei hoje a noite é retorno aqui com meu resultado.

Tudo bem?

Seu Mac está funcionando? Você conseguiu pular a página do MDM após atualizando para Sonoma?

@Mktulio
Copy link

Mktulio commented Jan 23, 2024

Para todas aquelas pessoas que estão contando fatos errados: > > Atualizei para 14.2.1 por cerca de 1h e consegui o ponto de menu de Registro MDM nas configurações e percebi que ele redefiniu meu "hack". Então reinicie > csrutil desativar > reiniciar > excluindo a pasta de configurações > criando Configurações e os 2 arquivos nela > reiniciar > csrutil habilitar > não há mais MDM > > .. Quero dizer, até a próxima grande atualização. Então@Signore74pare de falar besteira. // Que bom@philipp-winterle, faria hoje a noite é retorno aqui com meu resultado. > > Tudo bem? > > Seu Mac está funcionando? Você conseguiu pular a página do MDM após atualizando para Sonoma? // Sim! O meu esta rodando há duas semanas, não vi mais a mdm. Sonoma 14.2.1

@Mktulio
Copy link

Mktulio commented Jan 25, 2024

Bom dia!

Alguém atualizou para esta?

image

@ehsan58
Copy link

ehsan58 commented Jan 25, 2024

Bom dia!

Alguém atualizou para esta?

image

my question too. i am waiting to confirm by others if they did direct upgrade

@zorkal1992
Copy link

I am now getting this error while running the script
IMG_2891
I have also run the csrdisable command
Anyone seen this?

I’m getting the same errors appearing and I haven’t clicked on enrol when the pop up appears, is this why?

IMG_2891 Getting these errors when I run the above skipmdm.com script... Anyone seen this one? And I have also done the csrdisable command.

Got this same output.
@sonomadep @dawonderboy do we have to click enrol before trying this work around?

Just messaged the guy who made the mdmskip.com, on telegram he said restore your Mac and then try again. I was getting the same error so I’m currently restoring then I’ll run it again.

I have restored it and ran the skipmdm.com code and it worked.

Very easy rename (Data to Macintosh HD - Data )from disk utility

@EthanWarrick
Copy link

EthanWarrick commented Feb 1, 2024

Hello!

I was struggling with this Remote Management issue.

I own a 2019 Macbook Pro with an Intel CPU that I purchased used from my old college. I upgraded the OS from Ventura to Sonoma 14.3 and received an unavoidable/non-closable popup prompting me to enroll in Remote Management.

I fixed my issues using this thread and wanted to provide the steps that worked. Mainly, I want to provide an alternative to running the script(s) floating around. I was uncomfortable running any script as root in recovery mode. I was uncomfortable both due to security concerns and as I had valuable data on my hard drive that I didn't want to mess up. Also, I haven't read the entire thread so other things might have been addressed above that I am not addressing here.

Here are the steps that worked for me:

  1. Restart/Power computer holding cmd+r to enter recovery mode.
  2. Open the terminal.
  3. Run the following commands
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

For me removing the above files under /var/db/ did not work because they were not present. I included the commands because some people seemed to have luck with them. I still added (touched) the two files under /var/db just to be thorough.

  1. Type reboot to restart your computer and let it boot normally.
  2. Login and hopefully the popup doesn't appear.
  3. Edit the /etc/hosts file using your favorite editor: sudo vim /etc/hosts
  4. Add the following to the file:
    This hopefully stops your computer from accessing these domains on the internet - where the mdm information is stored on Apple's servers.
#block mdm connect
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
0.0.0.0 acmdm.apple.com
0.0.0.0 albert.apple.com

It is also worth mentioning that I had my internet turned off for the duration of this process. Even if you can get your WiFi turned off before the popup blocks you, that isn't good enough. It is still possible for your Macbook to auto connect to a known WiFi network at boot - even if you have turned that network off. I've heard people say that it can still connect even if you've forgotten the network as well. To be thorough I blacklisted my macbook from accessing the internet from my router's configuration. If your router doesn't have that functionality or you don't want to figure out how to do that, just unplugging your router for the duration of the process would work as well. Again, I'm not sure if completely staying of the internet was necessary but I did it to be safe.

Thank you to all above that contributed, you really saved my butt!

@rcarlosnyc
Copy link

Bom dia!

Alguém atualizou para esta?

image

Sim. Já. Consegui atualizar sem problemas.

@HOTEMOTICON
Copy link

HOTEMOTICON commented Feb 10, 2024

Hello!

I was struggling with this Remote Management issue.

I own a 2019 Macbook Pro with an Intel CPU that I purchased used from my old college. I upgraded the OS from Ventura to Sonoma 14.3 and received an unavoidable/non-closable popup prompting me to enroll in Remote Management.

I fixed my issues using this thread and wanted to provide the steps that worked. Mainly, I want to provide an alternative to running the script(s) floating around. I was uncomfortable running any script as root in recovery mode. I was uncomfortable both due to security concerns and as I had valuable data on my hard drive that I didn't want to mess up. Also, I haven't read the entire thread so other things might have been addressed above that I am not addressing here.

Here are the steps that worked for me:

  1. Restart/Power computer holding cmd+r to enter recovery mode.
  2. Open the terminal.
  3. Run the following commands
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

For me removing the above files under /var/db/ did not work because they were not present. I included the commands because some people seemed to have luck with them. I still added (touched) the two files under /var/db just to be thorough.

  1. Type reboot to restart your computer and let it boot normally.
  2. Login and hopefully the popup doesn't appear.
  3. Edit the /etc/hosts file using your favorite editor: sudo vim /etc/hosts
  4. Add the following to the file:
    This hopefully stops your computer from accessing these domains on the internet - where the mdm information is stored on Apple's servers.
#block mdm connect
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
0.0.0.0 acmdm.apple.com
0.0.0.0 albert.apple.com

It is also worth mentioning that I had my internet turned off for the duration of this process. Even if you can get your WiFi turned off before the popup blocks you, that isn't good enough. It is still possible for your Macbook to auto connect to a known WiFi network at boot - even if you have turned that network off. I've heard people say that it can still connect even if you've forgotten the network as well. To be thorough I blacklisted my macbook from accessing the internet from my router's configuration. If your router doesn't have that functionality or you don't want to figure out how to do that, just unplugging your router for the duration of the process would work as well. Again, I'm not sure if completely staying of the internet was necessary but I did it to be safe.

Thank you to all above that contributed, you really saved my butt!

Using this workaround it is safe to upgrade directly to 14.3.1 from 14.2.1?

@amylee-codes
Copy link

amylee-codes commented Feb 18, 2024

Hope this comment is now visible - it got hidden due to a problem with my account.

(Cross post to https://gist.github.com/henrik242/65d26a7deca30bdb9828e183809690bd?permalink_comment_id=4912658#gistcomment-4912658).

I managed getting rid of spyware and worse w/ Sonoma (14.3.1). So any statement that's not possible at all is wrong.

System Info (redacted, personal information filtered)

>sudo sysinfo
Software:

    System Software Overview:

      System Version: macOS 14.3.1 (23D60)
      Kernel Version: Darwin 23.3.0
      Boot Volume: Macintosh HD
      Boot Mode: Normal
      Computer Name: <>
      User Name: System Administrator (root)
      Secure Virtual Memory: Enabled
      System Integrity Protection: Enabled
      Time since boot: <>

Hardware:

    Hardware Overview:

      Model Name: MacBook Pro
      Model Identifier: Mac15,9
      Model Number: <>
      Chip: Apple M3 Max
      Total Number of Cores: 16 (12 performance and 4 efficiency)
      Memory: 128 GB
      System Firmware Version: 10151.81.1
      OS Loader Version: 10151.81.1
      Serial Number (system): <>
      Hardware UUID: <>
      Provisioning UDID: <>
      Activation Lock Status: Disabled
>sudo profiles list
There are no configuration profiles installed in the system domain

>sudo profiles show -type enrollment
Error fetching Device Enrollment configuration: We can't determine if this machine is DEP enabled.  Try again later.

Approach: Clean Wipe, Router Filter, skipmdm.com Script

This approach assumes you are able to create a bootable installer and wipe your system disk (be sure to have a backup in place!).

Prerequisites

Block Apple URLs

Before starting at all, make sure you block the following URLs in the internet router. I used a Fritz!Box and here the ("Blocked websites" filter) to block these URLs:

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

Make sure the blocker works (i.e. ping from another device)!

Clean Install

In recovery mode, wipe the hard disk and start a clean install with the bootable installer.

Activate the system

Connect to the internet once to activate the system (I could not proceed without). As the installer fails to connect to the enrollment servers, an error message will be displayed indicating that the status of the enrollment could not be verified.

Run the Script

In recovery mode, open Terminal and e.g. try to delete /var/db/ConfigurationProfiles/Settings - you should get a prompt for the installation user (starting w/ "_m...") - which is a good sign (no other users set up so far)!

Now just run the script from the USB stick. Hint: directly enter the username you'd like to use later (instead going w/ Apple:1234 - saves some time). The script should run without any errors (despite the long previous discussions).

Postwork

Block URLs in /etc/hosts

Before you proceed with the installation, reboot in recovery mode and change /etc/hosts by adding:

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
0.0.0.0 acmdm.apple.com
0.0.0.0 albert.apple.com

Disable agents

>sudo launchctl disable system/com.apple.ManagedClientAgent.enrollagent
>sudo launchctl disable system/com.apple.mdmclient.daemon
>sudo launchctl disable system/com.apple.devicemanagementclient.teslad
# You might check other services and disable them - know what you do!
>sudo launchctl print system | sort | grep enabled

Little Snitch

Finally a firewall comes in handy to possibly add even more security: I blocked

/usr/libexec/teslad
/usr/libexec/mdmclient

(for both user + system).

This works well for me and shows that it's possible to stop companies from installing spyware on their employees' devices - even on M3. B.t.w. - in many countries these practices are unlawful, so I see following this approach justified as a way of self-defense.

@ehsan58
Copy link

ehsan58 commented Feb 22, 2024

Hello!

I was struggling with this Remote Management issue.
I own a 2019 Macbook Pro with an Intel CPU that I purchased used from my old college. I upgraded the OS from Ventura to Sonoma 14.3 and received an unavoidable/non-closable popup prompting me to enroll in Remote Management.
I fixed my issues using this thread and wanted to provide the steps that worked. Mainly, I want to provide an alternative to running the script(s) floating around. I was uncomfortable running any script as root in recovery mode. I was uncomfortable both due to security concerns and as I had valuable data on my hard drive that I didn't want to mess up. Also, I haven't read the entire thread so other things might have been addressed above that I am not addressing here.

Here are the steps that worked for me:

  1. Restart/Power computer holding cmd+r to enter recovery mode.
  2. Open the terminal.
  3. Run the following commands
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

For me removing the above files under /var/db/ did not work because they were not present. I included the commands because some people seemed to have luck with them. I still added (touched) the two files under /var/db just to be thorough.

  1. Type reboot to restart your computer and let it boot normally.
  2. Login and hopefully the popup doesn't appear.
  3. Edit the /etc/hosts file using your favorite editor: sudo vim /etc/hosts
  4. Add the following to the file:
    This hopefully stops your computer from accessing these domains on the internet - where the mdm information is stored on Apple's servers.
#block mdm connect
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
0.0.0.0 acmdm.apple.com
0.0.0.0 albert.apple.com

It is also worth mentioning that I had my internet turned off for the duration of this process. Even if you can get your WiFi turned off before the popup blocks you, that isn't good enough. It is still possible for your Macbook to auto connect to a known WiFi network at boot - even if you have turned that network off. I've heard people say that it can still connect even if you've forgotten the network as well. To be thorough I blacklisted my macbook from accessing the internet from my router's configuration. If your router doesn't have that functionality or you don't want to figure out how to do that, just unplugging your router for the duration of the process would work as well. Again, I'm not sure if completely staying of the internet was necessary but I did it to be safe.

Thank you to all above that contributed, you really saved my butt!

Using this workaround it is safe to upgrade directly to 14.3.1 from 14.2.1?

it's mine question too :( no any update on this

@TomRider22
Copy link

Updated to 14.3.1, works for me, remove gdmf.apple.com from hosts before updating(in another way it wouldn't find updates). After updating finished, back it to hosts. Nothing special is needed if you are on 14.1.* - 14.2.* you can update your OS via UI (Software Update).
image

@TomRider22
Copy link

Just for info, for who had disk errors during the script run, it is updated with a fixed disk naming issue
https://github.com/skipmdm-phoenixbot/skipmdm.com/blob/main/Autobypass-mdm.sh

@RomanKoshkin
Copy link

The pinned guide didn't work for me (Sonoma 14.3, MBP M3). I couldn't edit the .plist files as instructed (the file is read-only and sudo didn't help). What worked for me though was this very simple guide.

  • in recovery mode csrutil disable and reboot in normal mode
  • while in normal mode do:
sudo su
cd /var/db/ConfigurationProfiles
rm -rf *
mkdir Settings
touch Settings/.profilesAreInstalled
  • reboot to recovery mode again and when in recovery mode csrutil enable. Reboot to normal mode. You shouldn't see the unremovable profiles again in System Preferences/Profiles

@PaxVobiscuit
Copy link

PaxVobiscuit commented Mar 4, 2024

Hope this comment is now visible - it got hidden due to a problem with my account.

(Cross post to https://gist.github.com/henrik242/65d26a7deca30bdb9828e183809690bd?permalink_comment_id=4912658#gistcomment-4912658).

I managed getting rid of spyware and worse w/ Sonoma (14.3.1). So any statement that's not possible at all is wrong.

System Info (redacted, personal information filtered)

>sudo sysinfo
Software:

    System Software Overview:

      System Version: macOS 14.3.1 (23D60)
      Kernel Version: Darwin 23.3.0
      Boot Volume: Macintosh HD
      Boot Mode: Normal
      Computer Name: <>
      User Name: System Administrator (root)
      Secure Virtual Memory: Enabled
      System Integrity Protection: Enabled
      Time since boot: <>

Hardware:

    Hardware Overview:

      Model Name: MacBook Pro
      Model Identifier: Mac15,9
      Model Number: <>
      Chip: Apple M3 Max
      Total Number of Cores: 16 (12 performance and 4 efficiency)
      Memory: 128 GB
      System Firmware Version: 10151.81.1
      OS Loader Version: 10151.81.1
      Serial Number (system): <>
      Hardware UUID: <>
      Provisioning UDID: <>
      Activation Lock Status: Disabled
>sudo profiles list
There are no configuration profiles installed in the system domain

>sudo profiles show -type enrollment
Error fetching Device Enrollment configuration: We can't determine if this machine is DEP enabled.  Try again later.

Approach: Clean Wipe, Router Filter, skipmdm.com Script

This approach assumes you are able to create a bootable installer and wipe your system disk (be sure to have a backup in place!).

Prerequisites

Block Apple URLs

Before starting at all, make sure you block the following URLs in the internet router. I used a Fritz!Box and here the ("Blocked websites" filter) to block these URLs:

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

Make sure the blocker works (i.e. ping from another device)!

Clean Install

In recovery mode, wipe the hard disk and start a clean install with the bootable installer.

Activate the system

Connect to the internet once to activate the system (I could not proceed without). As the installer fails to connect to the enrollment servers, an error message will be displayed indicating that the status of the enrollment could not be verified.

Run the Script

In recovery mode, open Terminal and e.g. try to delete /var/db/ConfigurationProfiles/Settings - you should get a prompt for the installation user (starting w/ "_m...") - which is a good sign (no other users set up so far)!

Now just run the script from the USB stick. Hint: directly enter the username you'd like to use later (instead going w/ Apple:1234 - saves some time). The script should run without any errors (despite the long previous discussions).

Postwork

Block URLs in /etc/hosts

Before you proceed with the installation, reboot in recovery mode and change /etc/hosts by adding:

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
0.0.0.0 acmdm.apple.com
0.0.0.0 albert.apple.com

Disable agents

>sudo launchctl disable system/com.apple.ManagedClientAgent.enrollagent
>sudo launchctl disable system/com.apple.mdmclient.daemon
>sudo launchctl disable system/com.apple.devicemanagementclient.teslad
# You might check other services and disable them - know what you do!
>sudo launchctl print system | sort | grep enabled

Little Snitch

Finally a firewall comes in handy to possibly add even more security: I blocked

/usr/libexec/teslad
/usr/libexec/mdmclient

(for both user + system).

This works well for me and shows that it's possible to stop companies from installing spyware on their employees' devices - even on M3. B.t.w. - in many countries these practices are unlawful, so I see following this approach justified as a way of self-defense.

FWIW, this worked for me. Some of the steps might need to be more prescriptive for folks not very familiar with Macs, but I got it working in one pass. If you want a different drive name than "Macintosh HD" you will need to edit the global constant lines of Autobypass-mdm.sh to reflect the drive name you want.

I did have to connect to the internet to activate as well, but as soon as I hit the "This device is owned by an organization" page, I hit COMMAND-Q, booted in to Recovery Mode, then picked up the instructions from there and ran the script.

@PaxVobiscuit
Copy link

PaxVobiscuit commented Mar 7, 2024

After using the method above to get to 14.3.1, how should I proceed to get to 14.4 or future 14.x updates?

Edit-

After no responses, I decided to try using the System Settings Software Updater, that seems to have worked as expected, and so far no enrollment screens after a couple days.

@reabo
Copy link

reabo commented Mar 16, 2024

Disable annoying Remote Management Pop-Up after upgrading to macOS Sonoma (14)

Apple further added a new gate preventing people from using their DEP-enabled Macs without installing the profiles in macOS Sonoma. After upgrading from a fully-working Ventura copy (with MDM servers blocked in hosts) to macOS Sonoma DP 1, your Mac will want to give you a pop-up window every 10 mins reminding you to install a DEP profile. Did some experiments and I think Apple is secretly pinging their MDM servers no matter you have an active profile associated w/ SN or not. As long as the servers are not reachable they will annoy you with their new pop-up system.

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

Can’t believe it but I think it worked! Thank you so much!

@joshlac
Copy link

joshlac commented Mar 16, 2024

After using the method above to get to 14.3.1, how should I proceed to get to 14.4 or future 14.x updates?

Edit-

After no responses, I decided to try using the System Settings Software Updater, that seems to have worked as expected, and so far no enrollment screens after a couple days.

How did you manage to see the update in System Settings? Mine just says "your Mac is up to date"....

@haohanw
Copy link

haohanw commented Mar 20, 2024

/etc/hosts
Check your host file and deblock "gdmf.apple.com"

@joshlac
Copy link

joshlac commented Mar 21, 2024

/etc/hosts
Check your host file and deblock "gdmf.apple.com"

It worked, I can see the update to 14.4 now. Can this be left unlocked for the future updates?

@PaxVobiscuit
Copy link

PaxVobiscuit commented Mar 22, 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

@joshlac
Copy link

joshlac commented Mar 29, 2024

To check that, open Terminal and enter the following command:
profiles status -type enrollment

I run the command and I see "No" to all...

@HAndresM
Copy link

Greetings, Do you know if there is a way to log in with this Macbook Air 2020 with Intel, it has remote administration with Jamf, it asks me to log in with a Microsoft business account when using a personal account it does not allow it and when giving local login it asks me for a password but I do not have it.

If there is any option?

WhatsApp Image 2024-03-29 at 17 01 54
WhatsApp Image 2024-03-29 at 17 02 03

@ohbrandon
Copy link

FWIW, this worked for me. Some of the steps might need to be more prescriptive for folks not very familiar with Macs, but I got it working in one pass. If you want a different drive name than "Macintosh HD" you will need to edit the global constant lines of Autobypass-mdm.sh to reflect the drive name you want.

I did have to connect to the internet to activate as well, but as soon as I hit the "This device is owned by an organization" page, I hit COMMAND-Q, booted in to Recovery Mode, then picked up the instructions from there and ran the script.

Just adding that this post in reply to the above method is what got me sorted out. Clean install (didn't have to use USB), reboot to recovery at the MDM screen, run bypass script and reboot. Dead simple.

@Omrtx999
Copy link

Omrtx999 commented Apr 11, 2024

what’s supposed to be done ?

@Mktulio
Copy link

Mktulio commented Apr 27, 2024

Anyone using Sonoma 14.4.1, after processing the post?

@ehsan58
Copy link

ehsan58 commented Apr 28, 2024

Anyone using Sonoma 14.4.1, after processing the post?

yes it's working normaly

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