mysql command line to clear out pending/failed jss Computer commands

andy_cauble
New Contributor III

I have a rogue Remove Profile command that is being sent out to all our macbooks, but all of them are currently turned off. So before any of them are turned on, I need to know what the MySQL command is to clear out all of the pending/failed Computer commands in the JSS. I've reached out to my Support but since its the weekend, I couldn't get anyone. If any Users know what it is and are willing to post it that would be awesome.

9 REPLIES 9

rderewianko
Valued Contributor II

JAMF doesn't mind us messing around with the JSS, customizing it how we want, Messing around with the Self Service APP etc. But when it comes to the MYSQL database, thats where things get real dangerous. Your best bet is to wait for them to get back to you.

  • RD

bpavlov
Honored Contributor

I know it won't help you right now, but please take the time to up vote these two feature requests so that something like this could easily be done without having to go into the database:

https://jamfnation.jamfsoftware.com/featureRequest.html?id=3619
https://jamfnation.jamfsoftware.com/featureRequest.html?id=3619

rderewianko
Valued Contributor II

@bpavlov I already voted on those :)

andy_cauble
New Contributor III

I would like to say that their support got back to me mid morning Sunday and got the script we needed to us. Left them a voice mail, and was lucky enough to have my phone call returned within the hour. I wasn't expecting that type of turnaround, but have continuously been pleasantly surprised by Jamf's support service.

dgreening
Valued Contributor II

Here is what I got from JAMF when I pinged them with this question:

To view and clear pending commands:

Before clearing or viewing, select the database: use jamfsoftware;
To view Pending:

elect count(*) from mobile_device_management_commands where apns_result_status !='Acknowledged';

To clear Pending codes:

delete from mobile_device_management_commands where apns_result_status !='Acknowledged';

I would definitely test these out in your dev environment first. They worked well for me!

ClarkPoole
New Contributor

If i'm not mistaken the command

delete from mobile_device_management_commands where apns_result_status != 'Acknowledged’;

Clears out Everything....Pending and Failed.

**There is a separate script if your just wanting to wipe out your Failed Commands.....

delete from mobile_device_management_commands where apns_result_status = 'Error';

bbelew
Contributor

I am having issues with a ton of iPads not connecting back to JSS. The solution seems to be deleting the pending and failed commands, and sending a blank push. Has anyone ran this mysql command on the latest version of JSS? I just want to make sure before I nuke my database.

Thanks!

cruess
New Contributor III

@andy.cauble Can you please post the script? Also, are you running these on the MYSQL or JSS?

andy_cauble
New Contributor III

@cruess like @rderewianko said above. When a user is inserting, updating or deleting using MYSQL, its best that they go through their technical Account Manager. That was the same response I got from our technical account manager too.