#!/bin/bash echo "Saisir le domaine :" read DOM cd domains rm domains.txt echo $DOM >> domains.txt cd .. echo echo "Exportation des comptes :" cd accounts rm users.txt zmprov -l gaa $DOM | tee -a users.txt cd .. echo echo "Exportation des informations sur les comptes :" cd account_details rm -r * for user in `cat ../accounts/users.txt`; do zmprov ga $user | grep -i Name: | tee -a $user.txt ; done cd .. echo echo "Exportation des mots de passe :" cd passwords rm -r * for user in `cat ../accounts/users.txt`; do zmprov -l ga $user userPassword | grep userPassword: | awk '{ print $2}' | tee -a $user.shadow; done cd .. echo echo "Exportation des listes de diffusion :" cd distribution_lists rm -r * zmprov gadl $DOM | tee -a distribution_lists.txt for list in `cat distribution_lists.txt`; do zmprov gdlm $list > $list.txt ;echo "$list"; done cd .. echo echo "Exportation des aliases :" cd aliases rm -r * for user in `cat ../accounts/users.txt`; do zmprov ga $user | grep zimbraMailAlias | awk '{print $2}' | tee -a $user.txt ;echo $i ;done cd .. echo echo "Fin de l'export des comptes !!!!!" echo "Lancer le script 2_imports_accounts sur le nouveau serveur"