Skip to content

Instantly share code, notes, and snippets.

@jasonslay
Last active December 1, 2020 16:14
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 jasonslay/10e6cb15b2302c73cfaef862434f2bc4 to your computer and use it in GitHub Desktop.
Save jasonslay/10e6cb15b2302c73cfaef862434f2bc4 to your computer and use it in GitHub Desktop.
MDM Migration
#! /bin/bash
SERIAL_NUMBER=$(ioreg -l | grep IOPlatformSerialNumber | cut -d "\"" -f 4)
echo "Serial Number: $SERIAL_NUMBER"
read -p "Send this serial number to Jason and press ENTER when he confirms the MDM server switch for your machine."
# Remove old stuff
sudo jamf removeMdmProfile
sudo jamf -removeFramework
# Get new profiles
sudo profiles renew -type enrollment
echo "Click on the system notification and allow the profiles to be installed."
# Upload FileVault recovery key to MDM server
read -p "Press ENTER when the profiles are installed"
sudo fdesetup changerecovery -personal -user $(whoami)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment