Skip to main content
Question

Can you trigger the update OS MDM command via Jamf api?


Forum|alt.badge.img+14
  • Honored Contributor
  • 351 replies

Hey folks.. just as title suggests, I was wondering if it's possible to trigger the install/schedule OS update MDM via the Jamf API. 

That way we can use a policy and start it a specific time in an effort to have all our Big Sur macs install updates and be compliant.  Otherwise I'm at the mercy of the "Nudge" app, which I really don't like.

I thought it may be possible as in the past I've used the API to send MDM unenroll commands when migrating computers from one JamfPro server to another.

5 replies

Forum|alt.badge.img+15
  • Esteemed Contributor
  • 719 replies
  • November 4, 2021

It can be done. Keep in mind the risk with running API scripts on client computers that contain credentials. You might  be better off building a process/script that runs from some kind of script server on a schedule.


Forum|alt.badge.img+14
  • Author
  • Honored Contributor
  • 351 replies
  • November 5, 2021
cbrewer wrote:

It can be done. Keep in mind the risk with running API scripts on client computers that contain credentials. You might  be better off building a process/script that runs from some kind of script server on a schedule.


@cbrewer Thank you.  Do you know the command line / script that will accomplish it?  We're not concerned about credentials.


Forum|alt.badge.img+15
  • Esteemed Contributor
  • 719 replies
  • November 5, 2021
ooshnoo wrote:

@cbrewer Thank you.  Do you know the command line / script that will accomplish it?  We're not concerned about credentials.


Classic API (JSSResource) > computercommands/command/ScheduleOSUpdate

 

You're probably going to have to build something. There are many examples out there of scripting the Jamf classic API.


Forum|alt.badge.img+7
  • Contributor
  • 25 replies
  • November 6, 2021
ooshnoo wrote:

@cbrewer Thank you.  Do you know the command line / script that will accomplish it?  We're not concerned about credentials.


I am trying to get a variation on this going - https://github.com/kdrwygvh/Sunstein_macOSUpdates

note: I'm pretty sure Jamf 10.33 breaks this process. I have a ticket open now to investigate. The result is that once the Mac gets to 11.6.1, it will keep reinstalling that same version and not install any other updates, like Safari.


Forum|alt.badge.img+14
  • Author
  • Honored Contributor
  • 351 replies
  • November 8, 2021
cbrewer wrote:

Classic API (JSSResource) > computercommands/command/ScheduleOSUpdate

 

You're probably going to have to build something. There are many examples out there of scripting the Jamf classic API.


Ok, so I tried the following and it doesn't alleviate the need for user authentication with Big Sur and Monterey.  Ugh... I was actually hoping this would be a way around it since sending the ScheduleOSUpdate command does work for us.  Why Apple does crap like this, I have no idea...  

 

uname="$4" pwd="$5" if [ "$6" != "" ];then server="$6" else ## get current Jamf server server=$(defaults read /Library/Preferences/com.jamfsoftware.jamf.plist jss_url) fi ## ensure the server URL ends with a / strLen=$((${#server}-1)) lastChar="${server:$strLen:1}" if [ ! "$lastChar" = "/" ];then server="${server}/" fi ## send unmanage command to machine curl -X POST -sku ${uname}:${pwd} ${server}JSSResource/computercommands/command/ScheduleOSUpdate

 

 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings