Advertisement
applehelpwriter

Password last changed date

Mar 14th, 2018
3,774
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.42 KB | None | 0 0
  1. #one liner command line to get last password set times for all users on the mac
  2.  
  3. # see http://applehelpwriter.com/2018/03/14/6228
  4. echo; echo Password Last Changed:; u=$(dscl . list /Users | egrep -v '^_|daemon|nobody'); for i in $u; do printf \\n$i\\t; currentUser=$i;t=$(dscl . read /Users/"$currentUser" | grep -A1 passwordLastSetTime | grep real | awk -F'real>|</real' '{print $2}'); date -j -f %s "$t" 2> /dev/null; done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement