Displaying 3 results from an estimated 3 matches for "act_exp".
Did you mean:
ac_ext
2017 Feb 07
3
How to get password expiration?
...null | grep "^$q" | awk '{print $2}')
if [ "$(echo ${accountExpires}|wc -c)" -gt 7 ];then
#microsoft uses 100 nanosecond increments so I remove the last 7 digits to
get seconds
#microsoft's epoch is jan 1 1601 so I subtract 11644430400 seconds to make
it unit time
act_exp=$(expr ${accountExpires::-7} - 11644430400)
days=$(expr $(expr $act_exp - `date "+%s"`) / 86400)
if [ "$days" -lt 30 ] && [ "$days" -gt 0 ];then
echo $user expires in $days days
fi
fi
done
On Fri, Feb 3, 2017 at 12:53 PM, Rowland Penny <rpenny at sa...
2017 Feb 07
0
How to get password expiration?
...cho ${accountExpires}|wc -c)" -gt 7 ];then
>> > #microsoft uses 100 nanosecond increments so I remove the last 7
>> > digits to get seconds
>> > #microsoft's epoch is jan 1 1601 so I subtract 11644430400 seconds
>> > to make it unit time
>> > act_exp=$(expr ${accountExpires::-7} - 11644430400)
>> > days=$(expr $(expr $act_exp - `date "+%s"`) / 86400)
>> > if [ "$days" -lt 30 ] && [ "$days" -gt 0 ];then
>> > echo $user expires in $days days
>> > fi
>> > fi
&g...
2017 Feb 03
2
How to get password expiration?
On my ubuntu machines I added
auth required pam_exec.so /scripts/password_expire.sh
to the beginning of /etc/pam.d/common-auth
it looks pretty similar to what I did below.
In the /etc/bash.bashrc
I added a check to wait for the file to be less than 1 second old before
looking at it.
break out after 5 seconds in case something failed or is taking longer then
it should.
now people get