Background
While recently testing a fresh enrollment of macOS Catalina 10.15.7 to ensure we’re still making it easy for our remaining stragglers to upgrade to macOS Monterey 12, I was focusing on our client-side logs and was surprised by the number of executions for our custom Update Inventory script.
After re-watching William Smith’s recent Speed Dating for Mac Admins, I felt inspired to reduce the number of inventory collections, based on when the computer was enrolled (i.e., when .AppleSetupDone was created).
We’re leveraging swiftDialog and Setup Your Mac for our post-enrollment policies. Several of the polices called while the Mac is being setup are reused if something goes sideways later on and they include our custom Update Inventory script.
However, inventory needs to be collected only once post-enrollment — as the final step — not each time a policy is executed (and nearly all of our policies include the script to update inventory).