Skip to main content
Question

Inventory Check in after MacOS update

  • July 21, 2021
  • 6 replies
  • 53 views

Forum|alt.badge.img+1

HI

I need some guidance, We have a policy via self-service that allows users to install MacOS upgrade. I want it to do an inventory check in once this has finished. 

I have tried to do a check in on start up but this hasn't worked

 

any suggestions would be welcome

6 replies

bwoods
Forum|alt.badge.img+14
  • Honored Contributor
  • July 21, 2021

Hi @ollyfurr , just clarifying that you are running an inventory update (sudo jamf recon) and not checking-in (sudo jamf policy). A policy with a "Maintenance" > "Update Inventory" payload should work for this. Execution Frequency should be at "Startup" as you mentioned. Scope it to All Computers since this is just an inventory update. 


jmahlman
Forum|alt.badge.img+17
  • Valued Contributor
  • July 21, 2021

We handle this with a custom script and outset. Basically, we have a script run with outset using the "boot-every" trigger that checks a plist file that was created when we installed the script. The plist just has the OS build in there and every boot it just checks if that has changed from the current build. If it changed, it runs a set trigger and then updates the plist file. If not, it just exits.

Works pretty darn well and it was super simple to implement. 


MrRoboto
Forum|alt.badge.img+9
  • Valued Contributor
  • July 21, 2021

I found this script a while back and it works well when run as a Jamf policy at every startup...

# Get the OS on the Mac OS_Version=$( sw_vers -productVersion ) # Check if the OS matches our logged one, do a recon if it doesn't. if [ -f /Library/MacSD/os_version ]; then Recorded_Version=$( cat /Library/MacSD/os_version ) if ! [ ${Recorded_Version} == ${OS_Version} ]; then /usr/local/bin/jamf recon echo ${OS_Version} > /Library/MacSD/os_version else echo "This Mac has rebooted but no OS change found. No recon necessary." fi else echo ${OS_Version} > /Library/MacSD/os_version fi

sdagley
Forum|alt.badge.img+25
  • Jamf Heroes
  • July 21, 2021

I found this script a while back and it works well when run as a Jamf policy at every startup...

# Get the OS on the Mac OS_Version=$( sw_vers -productVersion ) # Check if the OS matches our logged one, do a recon if it doesn't. if [ -f /Library/MacSD/os_version ]; then Recorded_Version=$( cat /Library/MacSD/os_version ) if ! [ ${Recorded_Version} == ${OS_Version} ]; then /usr/local/bin/jamf recon echo ${OS_Version} > /Library/MacSD/os_version else echo "This Mac has rebooted but no OS change found. No recon necessary." fi else echo ${OS_Version} > /Library/MacSD/os_version fi

The script @MrRoboto posted would be good to use as the script run by a LaunchDaemon every time a Mac restarts, but use

OS_Version=$( sw_vers -buildVersion )

instead because -productVersion isn't sufficient to see if the user has installed a Security Update for Mojave or Catalina where only the buildVersion changes.


easyedc
Forum|alt.badge.img+16
  • Esteemed Contributor
  • July 22, 2021

Another key that could help is enabled recon on network change.  I've found that's been a reliable trigger for our group as well. 


Forum|alt.badge.img+14
  • Valued Contributor
  • July 28, 2021

Hi @ollyfurr , just clarifying that you are running an inventory update (sudo jamf recon) and not checking-in (sudo jamf policy). A policy with a "Maintenance" > "Update Inventory" payload should work for this. Execution Frequency should be at "Startup" as you mentioned. Scope it to All Computers since this is just an inventory update. 


Startup doesn't work so well if the system is wireless.