csrutil disable
Restart computer
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/>
So that the changes take effect
Hi, this script made by me and I wrote for community while I have a mdm Macbook. Its too buggy and maybe made you bug when you use Keychain. I recommend guys bypass manually by terminal on Recovery after reinstall. If have any question can ask me below. I will not improve my script cuz I used Mac no MDM and my script copy many place without credit or no any mention ;)