You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
1.1 KiB

2 years ago
  1. #!/bin/bash
  2. echo "Saisir le domaine :"
  3. read DOM
  4. cd domains
  5. rm domains.txt
  6. echo $DOM >> domains.txt
  7. cd ..
  8. echo
  9. echo "Exportation des comptes :"
  10. cd accounts
  11. rm users.txt
  12. zmprov -l gaa $DOM | tee -a users.txt
  13. cd ..
  14. echo
  15. echo "Exportation des informations sur les comptes :"
  16. cd account_details
  17. rm -r *
  18. for user in `cat ../accounts/users.txt`; do zmprov ga $user | grep -i Name: | tee -a $user.txt ; done
  19. cd ..
  20. echo
  21. echo "Exportation des mots de passe :"
  22. cd passwords
  23. rm -r *
  24. for user in `cat ../accounts/users.txt`; do zmprov -l ga $user userPassword | grep userPassword: | awk '{ print $2}' | tee -a $user.shadow; done
  25. cd ..
  26. echo
  27. echo "Exportation des listes de diffusion :"
  28. cd distribution_lists
  29. rm -r *
  30. zmprov gadl $DOM | tee -a distribution_lists.txt
  31. for list in `cat distribution_lists.txt`; do zmprov gdlm $list > $list.txt ;echo "$list"; done
  32. cd ..
  33. echo
  34. echo "Exportation des aliases :"
  35. cd aliases
  36. rm -r *
  37. for user in `cat ../accounts/users.txt`; do zmprov ga $user | grep zimbraMailAlias | awk '{print $2}' | tee -a $user.txt ;echo $i ;done
  38. cd ..
  39. echo
  40. echo "Fin de l'export des comptes !!!!!"
  41. echo "Lancer le script 2_imports_accounts sur le nouveau serveur"