Flushing pending mobile device commands (but not all) via API

mdp
Contributor

Someone accidentally scoped an expensive app that we had 10 licenses for to 4000 iPads. They reversed the scope almost immediately, but now we have a pending command on 3990 iPads that's never going to go through. 

I have some experience with the API and shell scripting, so I thought I could grab a list of commands' UUIDs and delete the ones that meet my criteria, but I don't see a way to flush commands with any precision. Under commandflush, it looks like all I can do is delete all the pending commands on a particular mobile device, which for various reasons we don't want to do — just this one command. Any ideas?

 

---
Matthew Prins -- Jamf Scripts @ Github
2 REPLIES 2

obi-k
Valued Contributor II

Can you use that same scope/smart group and cancel the MDM commands?

 

Screen Shot 2022-09-06 at 1.55.17 PM.png

mdp
Contributor

The problem with doing it that way is that it would cancel all pending commands rather than only those specific mistaken commands, which we'd rather not do.

---
Matthew Prins -- Jamf Scripts @ Github