MacAdmin icon indicating copy to clipboard operation
MacAdmin copied to clipboard

Get-LastOSUpdateInstalled.py dependency?

Open cdenesha opened this issue 2 years ago • 1 comments

Hello,

This script leverages data from a local inventory on the Mac, possibly policy with ID=10.

local_inventory = "/opt/ManagedFrameworks/Inventory.plist"
execute_process("/usr/local/bin/jamf policy -id 10")

Do you have this documented somewhere? I couldn't find it..

I want to begin saving info on the Mac for later collection during recon, and your policy might teach me a good way!

thank you,

chris

cdenesha avatar Oct 14 '22 20:10 cdenesha

@cdenesha Sorry for the delay -- I was out of the office when you submitted this and have kept forgetting about it once I got back.

So on my fleet, I've been running some scripts that were previously "EAs" as normal scripts in Policies due to the nature of their results. For example, some EA values may not change very often, so instead of running them with each inventory, I run them on a less periodic Policy. Also, I'm trying to reduce the time that an Inventory takes to run. In addition, I've been working to move all of my EAs that are written in Python to Scripts as well, as our custom Python Framework isn't available (e.g. on initial enrollment/inventory).

So any of these scripts write to a locate Inventory.plist file and then I have extremely simple EAs that just defaults read Inventory.plist <key> and pick up the value. In some EAs (or scripts that are picked up by EAs) I actually write to another EA_History.log file that we can use to track the history of EA results since that's not possible in Jamf Pro. (Sometimes it's helpful to know what the value of the EAs was previously for troubleshooting purposes; sometimes just for debugging the EA itself.)

That Policy is a simple Inventory Policy that is scoped to "All Computers." You can override/change the value for your environment.

I do not have any of this documented outside of my code shared here at this time.

MLBZ521 avatar Oct 28 '22 16:10 MLBZ521