-
-
Save jhbush/0e2dda583e036c67ff68e626fe263de8 to your computer and use it in GitHub Desktop.
forcefully_remove_mdm_1013.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Seriously there still apparently aren't enough warning labels | |
# If you don't understand the consequences don't do it | |
# ################ | |
# #### May cause 10.13.2+ machines that were DEP-enrolled to not be considered as such | |
# ################ | |
# but really, you shouldn't do this | |
# one local user enabled for MDM come on apple | |
# ¯\_(ツ)_/¯ | |
REMOVE_PATHS=( "/var/db/ConfigurationProfiles/.passcodePolicesAreInstalled" | |
# "/var/db/ConfigurationProfiles/.cloudConfigHasActivationRecord" | |
# "/var/db/ConfigurationProfiles/.cloudConfigNoActivationRecord" | |
# "/var/db/ConfigurationProfiles/.cloudConfigProfileObtained" | |
# "/var/db/ConfigurationProfiles/.cloudConfigRecordFound" | |
# "/var/db/ConfigurationProfiles/.profilesAreInstalled" | |
"/var/db/ConfigurationProfiles/MDM_ComputerPrefs.plist" | |
"/Library/Keychains/apsd.keychain" | |
"/var/db/ConfigurationProfiles/Setup/" ) | |
for removePath in "${REMOVE_PATHS[@]}" | |
do | |
if [ -e "$removePath" ]; then | |
printf "Deleting: %s\n" "$removePath" | |
rm -rf "$removePath" | |
else | |
printf "Not found: %s\n" "$removePath" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment