Skip to content

Instantly share code, notes, and snippets.

@rtrouton
Created April 26, 2016 22:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rtrouton/b24595147028afeb81bdd53364d92048 to your computer and use it in GitHub Desktop.
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
#!/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