Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save Jeket/a33c6f9579ecc5f968a1bbd0dbbead84 to your computer and use it in GitHub Desktop.

Select an option

Save Jeket/a33c6f9579ecc5f968a1bbd0dbbead84 to your computer and use it in GitHub Desktop.

Revisions

  1. @opragel opragel renamed this gist Mar 24, 2021. 1 changed file with 0 additions and 0 deletions.
  2. @opragel opragel revised this gist Mar 24, 2021. 1 changed file with 5 additions and 9 deletions.
    14 changes: 5 additions & 9 deletions forcefully_remove_mdm_1013.sh
    Original file line number Diff line number Diff line change
    @@ -1,22 +1,18 @@
    #!/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"
    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"
    # "/var/db/ConfigurationProfiles/MDM_ComputerPrefs.plist"
    # "/var/db/ConfigurationProfiles/Setup"
    "/var/db/ConfigurationProfiles/Store"
    "/Library/Keychains/apsd.keychain"
    "/var/db/ConfigurationProfiles/Setup/" )
    )

    for removePath in "${REMOVE_PATHS[@]}"
    do
  3. @opragel opragel revised this gist Dec 10, 2017. 1 changed file with 1 addition and 4 deletions.
    5 changes: 1 addition & 4 deletions forcefully_remove_mdm_1013.sh
    Original file line number Diff line number Diff line change
    @@ -2,10 +2,7 @@
    # Seriously there still apparently aren't enough warning labels
    # If you don't understand the consequences don't do it
    # ################
    # #### Warning in 10.13 this will result in DEP-enrolled machines
    # #### not being DEP-enrolled, if re-enrolled outside of the DEP process.
    # #### If you re-enroll in MDM outside the DEP process, users will have
    # #### to approve the MDM profile for you to have full capabilities.
    # #### 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
  4. @opragel opragel revised this gist Dec 10, 2017. 1 changed file with 5 additions and 5 deletions.
    10 changes: 5 additions & 5 deletions forcefully_remove_mdm_1013.sh
    Original file line number Diff line number Diff line change
    @@ -12,11 +12,11 @@
    # ¯\_(ツ)_/¯

    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/.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/" )
  5. @opragel opragel revised this gist Nov 29, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion forcefully_remove_mdm_1013.sh
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    #!/bin/bash
    # Seriously there still apparently aren't not enough warning labels
    # Seriously there still apparently aren't enough warning labels
    # If you don't understand the consequences don't do it
    # ################
    # #### Warning in 10.13 this will result in DEP-enrolled machines
  6. @opragel opragel revised this gist Nov 29, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion forcefully_remove_mdm_1013.sh
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    #!/bin/bash
    # Seriously there are not enough warning labels
    # Seriously there still apparently aren't not enough warning labels
    # If you don't understand the consequences don't do it
    # ################
    # #### Warning in 10.13 this will result in DEP-enrolled machines
  7. @opragel opragel revised this gist Nov 29, 2017. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions forcefully_remove_mdm_1013.sh
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,6 @@
    #!/bin/bash
    # Seriously there are not enough warning labels
    # If you don't understand the consequences don't do it
    # ################
    # #### Warning in 10.13 this will result in DEP-enrolled machines
    # #### not being DEP-enrolled, if re-enrolled outside of the DEP process.
  8. @opragel opragel revised this gist Nov 6, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion forcefully_remove_mdm_1013.sh
    Original file line number Diff line number Diff line change
    @@ -17,7 +17,7 @@ REMOVE_PATHS=( "/var/db/ConfigurationProfiles/.passcodePolicesAreInstalled"
    "/var/db/ConfigurationProfiles/.profilesAreInstalled"
    "/var/db/ConfigurationProfiles/MDM_ComputerPrefs.plist"
    "/Library/Keychains/apsd.keychain"
    "/var/db/ConfigurationProfiles/Setup/" )
    "/var/db/ConfigurationProfiles/Setup/" )

    for removePath in "${REMOVE_PATHS[@]}"
    do
  9. @opragel opragel created this gist Nov 6, 2017.
    30 changes: 30 additions & 0 deletions forcefully_remove_mdm_1013.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,30 @@
    #!/bin/bash
    # ################
    # #### Warning in 10.13 this will result in DEP-enrolled machines
    # #### not being DEP-enrolled, if re-enrolled outside of the DEP process.
    # #### If you re-enroll in MDM outside the DEP process, users will have
    # #### to approve the MDM profile for you to have full capabilities.
    # ################
    # 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