for user in `cat /opt/zimbra/nfsbackup/migration/accounts/users.txt`;do zmprov ga $user| grep -i Name: | tee -a $user.txt ;done
cd ..
cd ..
echo
echo
echo"Exportation des mots de passe :"
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/opt/zimbra/nfsbackup/migration/passwords
rm /opt/zimbra/nfsbackup/migration/passwords/*
for user in `cat /opt/zimbra/nfsbackup/migration/accounts/users.txt`;do zmprov -l ga $user userPassword | grep userPassword: | awk '{ print $2}'| tee -a $user.shadow;done
for list in `cat distribution_lists.txt`;do zmprov gdlm $list > $list.txt ;echo"$list";done
for list in `cat /opt/zimbra/nfsbackup/migration/distribution_lists/distribution_lists.txt`;do zmprov gdlm $list > $list.txt ;echo"$list";done
cd ..
cd ..
echo
echo
echo"Exportation des aliases :"
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/opt/zimbra/nfsbackup/migration/aliases
rm /opt/zimbra/nfsbackup/migration/aliases/*
for user in `cat /opt/zimbra/nfsbackup/migration/accounts/users.txt`;do zmprov ga $user| grep zimbraMailAlias | awk '{print $2}'| tee -a $user.txt ;echo$i;done
for user in `cat /opt/zimbra/nfsbackup/migration/accounts/users.txt`;doecho"Exporting Default Signature : $user"; zmprov ga $user zimbraPrefMailSignatureHTML > sig/$user-sig.txt ;done
for user in `cat /opt/zimbra/nfsbackup/migration/accounts/users.txt`;doecho"Exporting Default Signature : $user"; zmprov ga $user zimbraPrefMailSignatureHTML > sig/$user-sig.txt ;done
sed -i -e "1d" /opt/zimbra/nfsbackup/migration/sig/*
sed -i -e "1d" /opt/zimbra/nfsbackup/migration/sig/*
sed -i -e 's/zimbraMailSieveScript: //g' /opt/zimbra/nfsbackup/migration/sig/*
sed -i -e 's/zimbraPrefMailSignatureHTML: //g' /opt/zimbra/nfsbackup/migration/sig/*