A script to Remove Existing Meraki Components and Unenroll from SystemsManager

arekdreyer
Contributor

Are you migrating from CiscoMerkai SystemsManager? Here's a script that @HCSTech wrote (with a tiny bit of help from me) to remove both the agent and the profile.

Also you might want to see this article on how to add this as a preinstall script to your QuickAdd package.

#!/bin/sh

####################################################
## Remove Existing Meraki Components and Unenroll MDM
####################################################

#!/usr/bin/env bash 

launchctl unload /Library/LaunchDaemons/com.meraki.agentd.plist
/bin/rm -f /usr/sbin/m_agent /usr/sbin/m_agent_upgrade
/bin/rm -rf '/Library/Application Support/Meraki/'
/bin/rm -f /Library/LaunchDaemons/com.meraki.agentd.plist

/usr/bin/profiles -R -p com.meraki.sm.mdm


exit 0
exit 1
3 REPLIES 3

saul_herman
New Contributor II

We just went through the same change and put together almost exactly the same script. Works really well!

mrben
New Contributor III

Thank you @arekdreyer. So far so good over here.

jmancuso
New Contributor III

/usr/bin/profiles -R -p com.meraki.sm.mdm
That was the one part I didn't include. Thanks