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
Either hardcode the value of the volume where you installed os in the place of
Macintosh HD
or read that value using the commanddiskutil info / | sed -n 's/^ *Volume Name: *//p'
and replace it whereMacintosh HD
is hardcoded.