#!/bin/bash# The following script will export all accounts to an import script.# this script should be run as zimbra user# target for ZCS 8, single server deployment# last update 2014-04-04# ognjen.miletic@gmail.com# original at http://www.3open.org/d/zimbra/export_accounts# customize these to your needs# work folder must be writable by zimbrawork_folder=/tmpimport_script=${work_folder}/accounts-import.shbrojac=0# reset files:echo "Kreiram prazan fajl ${import_script}";echo '' > ${import_script}echo "Eksportujem listu korisnika...";# get all account to $accountsaccounts=`zmprov -l gaa | egrep -v 'admin|wiki|galsync|spam|ham|virus|stimpson'`;echo "Gotovo";echo "Kreiram import skript...";# loop for each accountfor account in ${accounts}; doecho "${brojac} Eksportujem nalog ${account} ..."dn=`zmprov -l ga ${account} displayName | grep displayName | sed 's/displayName: //'`;up=`zmprov -l ga ${account} userPassword | grep userPassword | sed 's/userPassword: //'`;# generate import scriptecho "echo 'Import korisnika ${account}'" >> ${import_script}echo "zmprov ca ${account} ${up} displayName '${dn}'" >> ${import_script}echo "zmprov ma ${account} userPassword '${up}'" >> ${import_script}# add blank line separatorecho '' >> ${import_script}let brojac=brojac+1doneecho "Eksport gotov.";echo "Import skript je na putanji ${import_script}";echo "Kopirajte ga na novi server i pokrenite";
Senin, 13 April 2015
Export-Import All Zimbra Account Zimbra-8
Langganan:
Posting Komentar (Atom)
Tidak ada komentar:
Posting Komentar
Silahkan beri komentar ?