Created
April 26, 2016 22:04
-
-
Save rtrouton/b24595147028afeb81bdd53364d92048 to your computer and use it in GitHub Desktop.
This script is designed to fix the MDM computer-level profile for Casper
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 | |
# This script fixes the MDM computer-level profile for Casper | |
CheckBinary (){ | |
# Identify location of jamf binary. | |
jamf_binary=`/usr/bin/which jamf` | |
if [[ "$jamf_binary" == "" ]] && [[ -e "/usr/sbin/jamf" ]] && [[ ! -e "/usr/local/bin/jamf" ]]; then | |
jamf_binary="/usr/sbin/jamf" | |
elif [[ "$jamf_binary" == "" ]] && [[ ! -e "/usr/sbin/jamf" ]] && [[ -e "/usr/local/bin/jamf" ]]; then | |
jamf_binary="/usr/local/bin/jamf" | |
elif [[ "$jamf_binary" == "" ]] && [[ -e "/usr/sbin/jamf" ]] && [[ -e "/usr/local/bin/jamf" ]]; then | |
jamf_binary="/usr/local/bin/jamf" | |
fi | |
} | |
# Run the CheckBinary function to identify the location | |
# of the jamf binary for the jamf_binary variable. | |
CheckBinary | |
# Remove the existing Casper MDM profile | |
$jamf_binary removeMdmProfile -verbose | |
# Request a new MDM profile from the Casper server | |
$jamf_binary mdm -verbose |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment