This worked for me on M1 Pro 2021 with MacOS Ventura, original method was for Big Sur but I changed it using a different type of domain block since the old method doesn't work anymore:
First of all, if you want to trigger the notification you can use this command:
sudo profiles show -type enrollment
Now we will start. First block your Mac from reaching the domain iprofiles.apple.com. For this you can use your hosts file like:
echo "0.0.0.0 iprofiles.apple.com" | sudo tee -a /etc/hosts
or blocking them from your firewall.
Then, I checked the current enrollment profile:
sudo profiles show -type enrollment
This will show you the current enrollment configuration your Mac has, you can even block the domain mentioned in ConfigurationURL just to be safe, example:
echo "0.0.0.0 yourDomainMentionedInConfigurationURL" | sudo tee -a /etc/hosts
After that, I proceed to delete the profile, in my regular session, not recovery, although it would probably also work in recovery:
sudo profiles remove -all
Keep in mind that this command will delete all other profiles you may have, in my case, I didn't have any more.
Finally, you can check for the enrollment profile again. I would get an error saying that it could not retrieved given that I blocked the domain from where it's retrieved:
sudo profiles show -type enrollment
Error fetching Device Enrollment configuration: (34000) Error Domain=MCCloudConfigurationErrorDomain Code=34000 "The device failed to request configuration from the cloud." UserInfo={NSLocalizedDescription=The device failed to request configuration from the cloud., CloudConfigurationErrorType=CloudConfigurationFatalError}
And the notification is gone for good, hope it helps!
Hi, thanks for sharing. Does it work for Sonoma, too?