[Samba] Help removing many users

Chris Smith smb23 at realcomputerguy.com
Fri Jan 4 21:44:29 GMT 2008


On Friday 04 January 2008, Mike Eggleston wrote:
> I'm aware that you cannot use smbpasswd in a loop creating the
> accounts because you have to type in the password

Sure you can.
Example using a variable x for the username and, in this case, setting 
the password equal to the username:

echo -e "$x\n$x" | smbpasswd -a -s $x

followup with:

net sam set pwdmustchangenow $x yes &>/dev/null

and the user will be forced to change the password on first login

-- 
Chris


More information about the samba mailing list