Created
April 29, 2019 22:22
-
-
Save curi0usJack/5973657bb384d6dd7b5284a34abf38e0 to your computer and use it in GitHub Desktop.
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 | |
# 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