macOS, delete profiles that need password

Solution 1:

I managed to delete the profile by using this command

sudo profiles remove -forced -identifier=com.apple.mdm.macdm.22fba6f0-ff19-0138-d02e-003ee1c5a824.alacarte

Use this command to find the profile name

sudo profiles -Lv | grep "name: $4" -4 | grep -E 'name|profileIdentifier' | awk -F ': ' 'BEGIN {key = ""} { if (NR%2==1){key=$3}else{print key"==="$3}}'

Solution 2:

You can back up the Mac and then boot to recovery and erase it. The MDM profiles are designed to resist cracking so erase and restore is often the fastest method.

  • https://support.apple.com/en-us/HT204904