Jamf-Concepts / Setup-Manager

Enrollment progress manager
Other
83 stars 5 forks source link

Feature request: Store finish timestamp of successful completion of JSM #9

Open kinglok opened 1 month ago

kinglok commented 1 month ago

It would be very useful in creating smart groups based on the enrollment time through JSM if there is a flag file with completion time.

This will give us more granular control where policies can be run after x days of build.

It is suggested that completion time can be added to the flag file - /private/var/db/.JamfSetupEnrollmentDone

entusdictus commented 1 month ago

You already can. The flag file has a timestamp on it which can be utilized by an extension attribute. You may use this code snippet as a base for your extension attribute:

stat -x -t "%Y-%m-%d" "/private/var/db/.JamfSetupEnrollmentDone" | grep "Birth" | awk '{print $2}'

Of course you can adjust the timestamp and the awk to also include %H:%M:%S, if needed.

scriptingosx commented 1 month ago

shorter stat command:

stat -f %SB -t %FT%T /private/var/db/.JamfSetupEnrollmentDone