Domain Name Yahoo

Easy Help Troubleshoot Your Linux Box



  

Solve your problem here.

Yes, many Linux administrators are having problems. Browse your problem here, ask what to do and how to solve your problems. We are here for you.. DomainNameYahoo.info


Import into Samba

Here is a simple bash script to import a csv file into samba server.
# vi importsamba.sh
#!/bin/bash
CSVFILE=/home/domainnameyahoo/listusers.csv
CMD=`which smbldap-adduser`
for i in `cat $CSVFILE|sed ’s/, /,/g’`; do
UN=`echo $i | cut -f1 -d’,’`
PW=`echo $i | cut -f2 -d’,’`
echo $CMD$UN -P $PW
done
the CSV format is :
username1,password1
username2,password2
….
Hope this will help.

September 1st, 2009 Posted by admin | Samba | no comments