Displaying 2 results from an estimated 2 matches for "windowstimestamp".
2017 Feb 07
3
How to get password expiration?
figured out how to use ldapsearch also to get what I want.
Also found how to convert AD time to unix time
Another thing I wanted calculated was when an account expires.
ldapsearch -h ad.mydomain.tld -b dc=ad,dc=mydomain,dc=tld
"(sAMAccountName=$user)"
gives all the good information about a user.
here is how I used it to tell me all accounts expiring this next month.
h=ad.mydomain.tld
2017 Feb 07
0
How to get password expiration?
...ot;$days" -gt 0 ];then
>> > echo $user expires in $days days
>> > fi
>> > fi
>> > done
>>
>> Hmm, accountExpires != msDS-UserPasswordExpiryTimeComputed
>>
>> And from my internet investigations:
>>
>> unixtimestamp=$((($WindowsTimeStamp/10000000)-11676009600))
>>
>> $WindowsTimeStamp/10000000
> is equal to
> ${WindowsTimeStamp::-7}
> I don't know what is a more expensive operation catting a string or
> division(I guessed division was a more expensive operation).
>
> 11676009600 doesn't work ri...