Ventura docs for M2 Macs in this comment: https://gist.github.com/henrik242/65d26a7deca30bdb9828e183809690bd?permalink_comment_id=4555340#gistcomment-4555340
Old Monterey docs in this old revision: https://gist.github.com/henrik242/65d26a7deca30bdb9828e183809690bd/32c410e3a1de73539c76fa13ea5486569c4e0c5d
Solution for Sonoma: https://gist.github.com/sghiassy/a3927405cf4ffe81242f4ecb01c382ac
Simplified solution!
This is the result of hours spent going this thread both last year when upgrading to Big Sur and this year upgrading to Monterey.
In 2020 I tried the complex method elsewhere in this thread involving 'csrutil authenticated-root disable' and 'bless' with FileVault off and it actually did work. Unfortunately this year when I entered 'sudo profiles show -type enrollment', it actually re-activated my notifications, and I didn't want to go through all of that again.
I was very intrigued by the method noted by @MarveyMuzique, and then the notes in response to this by @jmcdonagh. I boiled this down to what I think is overall the simplest method that should work on pre-T2, T2, and probably apple silicon / M1 (although will need someone to verify). I have a mid 2017 MBP (pre-T2).
Before attempting any method, you need a DEP free admin profile established!
To do this, I wiped and re-installed fresh with my home WiFI physically unplugged so the profile could not be established. From elsewhere in this thread, I learned that once an admin account is established, the profile can not be automatically applied without permission, but notifications will be continuous.
To disable DEP notifications:
sudo nano /etc/hosts
To the end of this section, add
127.0.0.1 iprofiles.apple.com
The result should look like this:
Use control+ O to write then the "Return" key so that it writes over that file, then control+ X to exit.
With this one simple line added, there have been no notifications. No need to disable FileVault, no need to even reboot in Recovery mode.
sudo profiles show -type enrollment
now results in the following:
Error fetching Device Enrollment configuration: (34006) Error Domain=MCCloudConfigurationErrorDomain Code=34006 "The Device Enrollment server is unavailable. Please try again later." UserInfo={USEnglishDescription=CLOUD_CONFIG_MAX_RETRIES_EXCEEDED, NSLocalizedDescription=The Device Enrollment server is unavailable. Please try again later., MCErrorType=MCFatalError}