Skip to content

Instantly share code, notes, and snippets.

@curi0usJack
Created April 29, 2019 22:22
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save curi0usJack/5973657bb384d6dd7b5284a34abf38e0 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Converts AD pwdlastset field to readable date
# Kudos: https://www.adminsys.ch/2013/07/31/convert-active-directory-pwdlastset-attribute-readable-time/
function convert {
unixepoc=$((($1/10000000)-11644473600))
adlastset=$(/bin/date -d "1970-01-01 ${unixepoc} sec GMT")
echo -e ${adlastset}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment