Anyone do any work with cfgutil to automate restores of iOS devices in a cart?

georgecm12
Contributor III

We have several iPad carts around campus, most of which are still, sadly, running Configurator 1, due to the automatic refresh feature. However, as Configurator 1 has long since been replaced by Configurator 2, and no longer really functions properly under more current macOS versions, I've been trying to do some work with Configurator 2 and the cfgutil command-line program to try and replicate, as best as possible, the automatic refresh feature from Configurator 1. I've been basing my work on the information presented on https://configautomation.com/.

So far, small scale, my work has been reasonably successful. As long as you're connecting one-by-one, and you don't have more than 4 or 5 in the process of refreshing at any particular time, it mostly works. Larger numbers, particularly if you get anywhere above 10 or so, everything fails out miserably. It appears that cfgutil is returning an error of "no devices found."

Has anyone worked with cfgutil to create an automated cart refresh process?

(Yes, I am aware of Ground Control. Yes, it would be perfect for this use case. No, it isn't an option, for financial reasons.)

6 REPLIES 6

bumbletech
Contributor III

I do a lot with the Configurator 2 automation tools.

What's the desired end goal? I know you're trying to replicate the automatic refresh from Configurator 1 (it's been a while for me though), but is it possible you're trying to replicate a habit instead?

Edit: That is to say, are you just trying to create a workflow where you can easily reset all of the devices back to a clean, known setting with specified apps and configuration profiles?

bumbletech
Contributor III

This is what I've put together for my field team: https://github.com/bumbletech/casfigurator

The generic version is admittedly a little messy at this point. You still need to bounce between Config 2 and the script a bit, but it's still early in the development yet.

georgecm12
Contributor III

@jbourdon The desired end goal is to create an automated workflow where the iPads, upon connection to the computer, will easily reset themselves back to a clean, known setting.

The background is that this is for iPad carts stationed in various (sometimes somewhat distant) classrooms across the campus. The faculty and students who use these carts are not currently trained to perform any kind of maintenance on the iPads, and in my experience, be unlikely to diligently follow instructions that would be posted at the cart.

The goal is that they would plug the iPads in at the end of their class, whereupon the iPads would refresh themselves without any further action by a user. The iPads would prepare themselves to be used by a subsequent class, free of any changes the previous class might have done to them.

The specific desired tasks:
- The iPads would either erase or restore (don't really care which, at the moment)
- They would enroll themselves in the MDM
- They would rename themselves to the previous name they were given
- If there are any apps to be loaded, they would be then loaded to the devices.

As mentioned, I have a workflow that seems to do all of this, but only if a small number of devices are being acted upon concurrently. Larger numbers of devices being acted upon concurrently begin triggering cfgutil to start throwing all sorts of errors, and the workflow begins failing at various points.

brookstravis
New Contributor III

Did you ever have any luck getting this setup to work? It would be really nice if there were a MDM command to "erase all USER data" but leave managed profiles and apps in place.

Eigger
Contributor III

[https://configautomation.com/attach-workflow.html](link URL)

balexander667
New Contributor III

this is an old post, but I figured I'd write all this down..this is for DEP enabled devices
create a local mobileconfig file with your wireless payload have devices added to prestage in JAMF and prepare config profiles for restrictions/apps/settings...
created a script called prepare.sh:

#!/bin/bash
/usr/local/bin/cfgutil -f restore
/usr/local/bin/cfgutil -f pair
/usr/local/bin/cfgutil -f install-profile /Users/user/Documents/Wireless.mobileconfig
/usr/local/bin/cfgutil -f prepare --dep --skip-language --skip-region

run prepare.sh

the configurator station can also be set to run this as "when devices are connected" by running:

cfgutil exec -a /Users/user/Documents/Prepare.sh

exec will remain running in your terminal session and kick off that script whenever a paired iOS device (or iOS device that's not paired to any computer) is attached