Quote:
Originally Posted by gyt use this script and it will all users:
1 - add all users information in a txt file and name it users.txt
2- users.txt should contains information like this example:
username:user_password:First Name Lastname
3- copy users.txt to server tmp folder
4- create bash script and name it users.sh on tmp folder contains this script
#!/bin/sh
INFILE=users.txt
DOMAIN=domain.com
for line in $(seq 1 `cat $INFILE | wc -l`); do
LINE=`cat $INFILE | head -$line | tail -1`
username=`echo $LINE | cut -d: -f1`
password=`echo $LINE | cut -d: -f2`
fullname="`echo $LINE | cut -d: -f3`"
firstname=`echo $fullname | cut -d" " -f1`
lastname=`echo $fullname | awk -F' ' '{print $NF}'`
echo zmprov createAccount $username@$DOMAIN $password displayName \""$fullname"\" sn $lastname givenName $firstname
done
5- change domain.com to your domain
6- chmod 777 users.txt users.sh
7- su zimbra
8- run users.sh from tmp folder like this : [zimbra@email tmp]$ ./users.sh >final.sh
9- final.sh file will be created, after finish change file mode to be like chmod 777 final.sh
10- run the final.sh file and you will get all users added to zimbra
enjoy |
Yeh, i have written a more elaborate script in python, that's not really my point. I haven't seen changelog that the Bulk Import is deprecated etc, and i liked how you can add users through the interface , even with empty passwords etc.