Mass Change Mobile App Distribution Method?

cgalik
Contributor

I have a slew of mobile device apps that I need to switch from "Install Automatically" to "Make Available in Self Service." I was hoping that there was a way I could do so without having to touch every individual app. Has anyone here encountered this problem before, and more importantly, found a solution?

3 REPLIES 3

Emmert
Valued Contributor

If you're self hosted you should be able to make this change in the MySQL database with a custom query. I'd run it by your Jamf Buddy first of course.

cgalik
Contributor

Yeah, that's what I was thinking, but I don't like to muck about in MySQL w/o JAMF approval, so I checked w/ chat support, who suggested I bring the question over here. I'll open a support case w/ my JAMF Buddy and see where that goes. Fingers crossed!

bburdeaux
Contributor II

I'd advise against doing it in the database, but you can make the change using the API. You'll need a CSV list of apps, with the names exactly as they appear in the app catalog. You're changing the deploy_automatically attribute from true to false. I'll include a basic version of the script below.

#!/bin/sh

TARGET = /Path/to/list.csv

cat $TARGET | while read NAME; do
curl -sk -u username:password -H "Content-Type: text/xml" -d "<?xml version="1.0" encoding="ISO-8859-1"?><mobile_device_application><general><deploy_automatically>false</deploy_automatically></general></mobile_device_application>" https://your.jss.url:8443/JSSResource/mobiledeviceapplications/name/$NAME -X PUT
done