Skip to content

Integrations

jenjac edited this page Jan 7, 2019 · 12 revisions

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.

Munki Integrations

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.

Installing VPP Apps Using "nopkg" Items

To use this integration, follow the steps below:

  1. Download the plists from the repo Here.
  2. Replace the YOUR_WEBAPP_URL text in each plist with the url of your SheetsMDM web app.
  3. Add the nopkgs to your Munki repo, and to a manifest for a test client.
  4. 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.

Running a Munki Package On-Demand Using MDM

  1. Clone the sheetsmdm-example repo to your technician machine.
    cd ~/Documents
    git clone https://github.com/jenjac/sheetsmdm-example.git
  2. Open the packages directory at ~/Documents/sheetsmdm-example/packages.
  3. Edit the postinstall file in the scripts directory and replace YOUR_WEBAPP_URL with the url of your SheetsMDM web app, and save the file.
  4. 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)" -upload

That 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.

  1. Create a manifest in your Munki repo called mdm-invoked.
  2. 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!

  1. In your SheetsMDM spreadsheet select the "SheetsMDM" menu, then "Run Commands" and select "Invoke Munki Install".
  2. A dialog will open, enter the package name of one of the packages that you included in mdm-invoked.
  3. 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.

Other Integrations

Clone this wiki locally