Skip to main content
Question

Smart Group Apple TV restart

  • January 30, 2026
  • 5 replies
  • 56 views

AmanCognita
Forum|alt.badge.img+1

Hi So, we got a case in my school where we want to start restarting Apple TV on a weekly basis, Having an issue getting back to api after sometime, I’ve managed to get the GET command to read the smart group but have issues for find the correct command to reboot, can anyone help?

5 replies

atomczynski11
Forum|alt.badge.img+18

In our educational environment, I manage several hundred Apple TVs across classrooms and common areas. I found that periodically restarting them helped reduce AirPlay issues, so I looked for a way to automate the process instead of relying on manual reminders.

I documented the approach here:
https://www.linkedin.com/pulse/how-issue-restart-mobile-device-command-en-masse-jamf-adam-tomczynski-3buvc/

Since then, the Task Server hardware has been retired, and with newer versions of tvOS, regular restarts have become unnecessary. I hope you find this information helpful.


LysetteB
Forum|alt.badge.img+16
  • Community Manager
  • February 2, 2026

Thanks ​@atomczynski11! ​@AmanCognita  hope you found this useful 🤞🏼 


AmanCognita
Forum|alt.badge.img+1
  • Author
  • New Contributor
  • February 3, 2026

tried this having issues with access token, also which api roles are needed? is it mdm commands?


atomczynski11
Forum|alt.badge.img+18
  • Jamf Heroes
  • February 4, 2026

Hello.
The following privileges are needed:

 

Create Mobile Devices, Read Mobile Devices, Send Mobile Device Restart Device Command, Read User

 

 


atomczynski11
Forum|alt.badge.img+18
  • Jamf Heroes
  • February 4, 2026

This should get you started:

 

#!/bin/bash

### Adam Tomczynski
### July 23, 2024
###
### used to work with Jamf using the API
### remember the sanity check on line 26
### remember to modify the baseURL, create a new API role, and assign the role to the user
### remember on line 20 to "http"



baseURL="pretendco.com"
client_id="61703271-9e88-43c2-830b-eb26ad2309f8"
client_secret="gGA97uB2SsBQ1Xv34Cvz1_3WPfEZB0oPXrf3M8BuITmkswVazvHNBfdhukGNaQ8q"



access_token=$(curl --silent --location \
--request POST "https://$baseURL/api/oauth/token" \
--header "Content-Type: application/x-www-form-urlencoded" \
--data-urlencode "client_id=$client_id" \
--data-urlencode "grant_type=client_credentials" \
--data-urlencode "client_secret=$client_secret" | plutil -extract "access_token" raw -o - -)


#echo $access_token
# sanity check passed

#for dept in Art Music Math Science History
#do
# curl -s -X POST https://$baseURL/JSSResource/departments/id/0 -H "Content-Type: application/xml" -H "Authorization: Bearer $access_token" -d "<department><name>$dept</name></department>"
#done

#Remote Restart on iPad
# curl -s -X POST https://$baseURL/JSSResource/mobiledevicecommands/command/RestartDevice/id/100 -H "Content-Type: application/xml" -H "Authorization: Bearer $access_token"


#Remote Restart of device "Demo Apple TV" Apple TV
# curl -s -X POST https://$baseURL/JSSResource/mobiledevicecommands/command/RestartDevice/id/16642 -H "Content-Type: application/xml" -H "Authorization: Bearer $access_token"