Web lists-archives.com

Re: [Samba] Users list and the date the password will expire




Hi Rowland,

I'm getting the same error here, on bash.

Edited the script per your request, and the output looks sane:

root@dc4:~# ./expired_passwords
User: DOMAIN\onyteemenam
User: onyteemenam
root@dc4:~#

So no problem there?

I'm on debian wheezy with samba 4.4.4.

MJ

On 02/09/2017 01:14 PM, Rowland Penny via samba wrote:
On Thu, 9 Feb 2017 12:49:12 +0100
Ole Traupe via samba <samba@xxxxxxxxxxxxxxx> 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")


I initially got that, so I added:
user=$(echo "${user}" | awk -F '\\' '{print $2}')

because, 'wbinfo -u' gives you 'DOMAIN\username'

It looks like for some reason this is failing, are you using 'dash'
instead of 'bash' ?

You could try adding 'echo "User: ${user}" ' above and below line 25

i.e. Change:

for user in $user_list; do
    user=$(echo "${user}" | awk -F '\\' '{print $2}')

To:

for user in $user_list; do
    echo "User: ${user}"
    user=$(echo "${user}" | awk -F '\\' '{print $2}')
    echo "User: ${user}"
    break

This should print the username before and after the removal of the
domain name and then break out of the loop.

Rowland


--
To unsubscribe from this list go to the following URL and read the
instructions:  https://lists.samba.org/mailman/options/samba