-
Notifications
You must be signed in to change notification settings - Fork 2
Integrations
The open API of MicroMDM and the Command Webhook functionality provide easy integration into many different solutions. In this section I will describe some of the integrations that we have developed for use at Bethel University.
In the SheetsMDM interface, and code, I have developed a way to create a "nopkg" item in Munki that sends a call to the SheetsMDM web app requesting a VPP app get installed. I have also developed an installer package that can be sent out to a Munki client through MDM that starts the install of a particular Munki package on-demand.
To use this integration, follow the steps below:
- Download the plists from the repo Here.
- Replace the
YOUR_WEBAPP_URLtext in each plist with the url of your SheetsMDM web app. - Add the nopkgs to your Munki repo, and to a manifest for a test client.
- Choose to install the package using the "Managed Software Center" application.
The post-install script for the nopkg item will send a request to your SheetsMDM web app, and the doGet function in the responses.gs file will process the request, and send an InstallApplication command to the device to start the install of the VPP app.
You can create as many of these "nopkg" items as you want. You just have to update the app information to reflect a different VPP app, and put in a different app ID, from the app store.
The VPP_Install_All_Assigned nopkg sends "all_assigned" to the web app in place of an app ID, and causes the script to query the VPP token for all apps assigned to that serial number and sends an InstallApplication command for all the apps, one after another.
If a license tracked by the VPP token set up in SheetsMDM is assigned to the device serial, it will install! This works especially well because SheetsMDM is set up to auto-assign a set of VPP apps to every device that enrolls.
- Clone the sheetsmdm-example repo to your technician machine.
cd ~/Documents
git clone https://github.com/jenjac/sheetsmdm-example.git - Open the
packagesdirectory at~/Documents/sheetsmdm-example/packages. - Edit the
postinstallfile in the scripts directory and replaceYOUR_WEBAPP_URLwith the url of your SheetsMDM web app, and save the file. - Generate a payload-free package using these Terminal commands as an example:
pkgbuild --identifier com.company.mdm_munki_install --nopayload --scripts "/Users/username/Documents/sheetsmdm-example/packages/MDM Invoked Munki Software Install/scripts" "/Users/username/Documents/sheetsmdm-example/packages/MDM Invoked Munki Software Install/mdm_munki_install.pkg"
productbuild --package "/Users/username/Documents/sheetsmdm-example/packages/MDM Invoked Munki Software Install/mdm_munki_install.pkg" "/Users/username/Documents/sheetsmdm-example/packages/MDM Invoked Munki Software Install/MDM_Invoked_Munki_Software_Install.pkg"
mdmctl apply app -pkg "/Users/username/Documents/sheetsmdm-example/packages/MDM Invoked Munki Software Install/MDM_Invoked_Munki_Software_Install.pkg" -sign "Developer ID Installer: Your Name (YOURID)" -uploadThat will build the signed distribution style package that MDM needs, and upload it to the MicroMDM repo.
Next, Munki must be configured to respond to the MDM_Invoked_Munki_Software_Install.pkg.
- Create a manifest in your Munki repo called
mdm-invoked. - Add any packages that you want to invoke via MDM to
Optional Installs.
You do not need to add the mdm-invoked manifest as an included manifest to any other manifest.
Now you are ready to test it out!
- In your SheetsMDM spreadsheet select the "SheetsMDM" menu, then "Run Commands" and select "Invoke Munki Install".
- A dialog will open, enter the package name of one of the packages that you included in
mdm-invoked. - Verify the device information and select "Confirm".
When the command runs it will install the MDM_Invoked_Munki_Software_Install.pkg on the selected client, which will run the postinstall script. The script will pick up the desired Munki package name that you entered, and run the package.
- Crypt
- Sal
- Kolide Fleet
- Snipe-IT
- Slack
- IFTTT
- Amazon Alexa
- Munki Control with Flask
- iOS Shortcuts