Posted on 07-18-2017 01:50 PM
Once upon a time, someone needed to unenroll from one MDM instance and enroll in their new Jamf Pro instance. They modified their QuickAdd package to include a preinstall script to unenroll from the old MDM instance.
Here's how to use Composer to add a preinstall script to your QuickAdd package. I worked with @HCSTech for this post.
Use Recon to create a QuickAdd Package for your Jamf Pro (it doesn't matter if you sign it or not).
If you see the window titled "Choose a method to create your package," click Cancel.
In Finder, drag the QuickAdd package to the sidebar of Composer.
In Composer, click Convert to Source.
In the Sources section, select the QuickAdd package that was just created.
Click the disclosure triangle for the new package.
Right-click Scripts, choose Add Shell Script, then choose preinstall.
Select the preinstall script.
Edit the preinstall script. See this article for a sample preinstall script that unenrolls the Mac from a previous MDM instance.
Select your package in the Sources section of the Composer sidebar.
At the "Do you want to save changes" dialog, click Save.
Click Build as Package in the toolbar.
Specify the destination to save the package, then click Save.
Note that if you save your new QuickAdd.pkg in the same location as your original QuickAdd.pkg, your old QuickAdd.pkg is renamed to "QuickAdd old.pkg ".
Copy the QuickAdd package to a test Mac that's enrolled in a different MDM instance.
Open the package and complete the installation.
Open the Profiles preferences and confirm that the Mac is enrolled in your desired Jamf Pro.