Created
July 10, 2026 01:18
-
-
Save manicmachine/661df715ab20453636f840ccde7014f7 to your computer and use it in GitHub Desktop.
Jamf Pro EA: Management Account Password Last Set
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| account="laps_account" # replace this with the account you wish to track | |
| passwordLastSetTimeEpoch=$(/usr/bin/dscl . read "/Users/$account" accountPolicyData | /usr/bin/awk -F'[><]' '/<key>passwordLastSetTime<\/key>/{getline; print $3}' | /usr/bin/cut -d '.' -f1) | |
| # Time in UTC -- use `date -jf` if you want the time in local timezone instead | |
| echo "<result>$(/bin/date -juf %s "$passwordLastSetTimeEpoch")</result>" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment