search for: exp_days

Displaying 11 results from an estimated 11 matches for "exp_days".

2017 Feb 08
4
Users list and the date the password will expire
...set_date -gt 1 ]; then UNIXTimeStamp=$((($set_date/10000000)-11644473600)) then_sec=`date -d "1970-01-01 $UNIXTimeStamp sec GMT" +%s` now_sec=`date +%s` diff_days=$(( ( $now_sec - $then_sec )/60/60/24 )) exp_days=$(( $max_pwAge - $diff_days )) if [ $exp_days == 90 ] || [ $exp_days == 60 ] || [ $exp_days == 30 ]; then mail_string=`ldbsearch -H /usr/local/samba/private/sam.ldb -s sub -b $basedn cn=$user | grep mail` echo "Gotcha: $use...
2017 Feb 08
3
Users list and the date the password will expire
...imeStamp=$((($set_date/10000000)-11644473600)) > > then_sec=`date -d "1970-01-01 $UNIXTimeStamp sec > > GMT" +%s` > > now_sec=`date +%s` > > diff_days=$(( ( $now_sec - $then_sec )/60/60/24 )) > > exp_days=$(( $max_pwAge - $diff_days )) > > > > if [ $exp_days == 90 ] || [ $exp_days == 60 ] || [ > > $exp_days == 30 ]; then > > > > mail_string=`ldbsearch -H > > /usr/local/samba/private/sam.ldb -s sub -b $basedn cn=$user | gre...
2017 Feb 09
1
Users list and the date the password will expire
On 02/09/2017 11:25 AM, Ole Traupe via samba wrote: > Exactly, and got reminded that I don't have to grep anything but can ask > for specific parameters. Been a while that I used ldbsearch. ;) > So there will be an updated version of your script? :-) Your script is something we could use as well, appreciated! MJ
2017 Feb 09
3
Users list and the date the password will expire
...ntName=$user))" msDS-UserPasswordExpiryTimeComputed | grep "msDS-UserPasswordExpiryTimeComputed: " | sed "s|msDS-UserPasswordExpiryTimeComputed: ||") > UNIXTimeStamp=$((("${user_expire_date}"/10000000)-11644473600)) > date_now=$(date +%s) > exp_days=$((("${UNIXTimeStamp}" - "${date_now}") / 3600 / 24)) > if [ "${exp_days}" -le "0" ]; then > mail_string=$(ldbsearch --url="${LDBDB}" -b "${domainDN}" -s sub "(&(objectCategory=person)(objectClass=user)(sAMAcco...
2017 Feb 09
0
Users list and the date the password will expire
...ass=user)(sAMAccountName=$user))" msDS-UserPasswordExpiryTimeComputed | grep "msDS-UserPasswordExpiryTimeComputed: " | sed "s|msDS-UserPasswordExpiryTimeComputed: ||") UNIXTimeStamp=$((("${user_expire_date}"/10000000)-11644473600)) date_now=$(date +%s) exp_days=$((("${UNIXTimeStamp}" - "${date_now}") / 3600 / 24)) if [ "${exp_days}" -le "0" ]; then mail_string=$(ldbsearch --url="${LDBDB}" -b "${domainDN}" -s sub "(&(objectCategory=person)(objectClass=user)(sAMAccountName=$use...
2017 Feb 09
0
Users list and the date the password will expire
...serPasswordExpiryTimeComputed | grep >> "msDS-UserPasswordExpiryTimeComputed: " | sed >> "s|msDS-UserPasswordExpiryTimeComputed: ||") >> UNIXTimeStamp=$((("${user_expire_date}"/10000000)-11644473600)) >> date_now=$(date +%s) >> exp_days=$((("${UNIXTimeStamp}" - "${date_now}") / 3600 / 24)) >> if [ "${exp_days}" -le "0" ]; then >> mail_string=$(ldbsearch --url="${LDBDB}" -b "${domainDN}" -s >> sub >> "(&(objectCategory=perso...
2017 Feb 08
0
Users list and the date the password will expire
...]; then > > UNIXTimeStamp=$((($set_date/10000000)-11644473600)) > then_sec=`date -d "1970-01-01 $UNIXTimeStamp sec GMT" > +%s` > now_sec=`date +%s` > diff_days=$(( ( $now_sec - $then_sec )/60/60/24 )) > exp_days=$(( $max_pwAge - $diff_days )) > > if [ $exp_days == 90 ] || [ $exp_days == 60 ] || [ > $exp_days == 30 ]; then > > mail_string=`ldbsearch -H > /usr/local/samba/private/sam.ldb -s sub -b $basedn cn=$user | grep mail` >...
2017 Feb 09
0
Users list and the date the password will expire
...ate/10000000)-11644473600)) >>> then_sec=`date -d "1970-01-01 $UNIXTimeStamp sec >>> GMT" +%s` >>> now_sec=`date +%s` >>> diff_days=$(( ( $now_sec - $then_sec )/60/60/24 )) >>> exp_days=$(( $max_pwAge - $diff_days )) >>> >>> if [ $exp_days == 90 ] || [ $exp_days == 60 ] || [ >>> $exp_days == 30 ]; then >>> >>> mail_string=`ldbsearch -H >>> /usr/local/samba/private/sam.ldb -s sub -b $bas...
2017 Feb 09
5
Users list and the date the password will expire
On Thu, 9 Feb 2017 12:49:12 +0100 Ole Traupe via samba <samba at lists.samba.org> wrote: > Never mind. However, with your update I get the following error right > on the first found "user": > > ./mailtest_rowland.sh: line 27: (""/10000000)-11644473600: syntax > error: operand expected (error token is """/10000000)-11644473600") >
2017 Feb 09
0
Users list and the date the password will expire
...jectClass=user)(sAMAccountName=$user))" msDS-UserPasswordExpiryTimeComputed | grep "msDS-UserPasswordExpiryTimeComputed: " | sed "s|msDS-UserPasswordExpiryTimeComputed: ||") UNIXTimeStamp=$(((${user_expire_date}/10000000)-11644473600)) date_now=$(date +%s) exp_days=$(((${UNIXTimeStamp} - ${date_now}) / 3600 / 24)) With the 'awk' the user is empty. Querying $user before the awk shows the correct user name without "DOMAIN\". This line seems not to be necessary for me. I also had to remove the quotes in the 3rd and last of these lines: e.g...
2017 Feb 09
2
Users list and the date the password will expire
...ame=$user))" > msDS-UserPasswordExpiryTimeComputed | grep > "msDS-UserPasswordExpiryTimeComputed: " | sed > "s|msDS-UserPasswordExpiryTimeComputed: ||") > UNIXTimeStamp=$(((${user_expire_date}/10000000)-11644473600)) > date_now=$(date +%s) > exp_days=$(((${UNIXTimeStamp} - ${date_now}) / 3600 / 24)) > > With the 'awk' the user is empty. Querying $user before the awk shows > the correct user name without "DOMAIN\". This line seems not to be > necessary for me. > > I also had to remove the quotes in the 3rd a...