Good, better and best methods to leave and retrieve client-side breadcrumbs with Jamf Pro
As a Jamf Pro administrator managing Apple computers running macOS, you frequently need to leave a client-side record when a policy was executed, which is sometimes referred to as a “breadcrumb”; you also need an easy way to retrieve this data.
@dan-snelson Thanks as always for sharing. That people in the Jamf Pro community are willing to share their work so that others don't need to re-invent the wheel is of the major things I like about the community.
That said, a small quibble with your use of the defaults command to manipulate a plist for the "best" approach... Per the man page for defaults: "WARNING: The defaults command will be changed in an upcoming major release to only operate on preferences domains. General plist manipulation utilities will be folded into a different command-line program."
That warning has been around for a while, so who knows when Apple will finally follow through, but in order not to find out the hard way I'd suggest utilizing /usr/libexec/PlistBuddy as the plist manipulation tool instead.
What Apple thinks is enough runway will be interesting to see. As one of the few people to have ever produced a product based on A/ROSE and the Macintosh Coprocessor Platform let's just say that when Apple starts making noises about something being deprecated I want to start making use of an alternative sooner rather than later.