Exchange – Redémarrer facilement les services
Exchange est la solution proposée par Microsoft pour mettre en place un serveur de messagerie. Cependant je suis sûr que certains d'entre vous ont déjà redémarré le serveur et les services Exchange n'ont pas redémarré (alors qu'ils sont en automatique.) Voici des petits scripts pour vous faciliter la tâche.
Exchange et le Powershell
Ah le fameux Powershell ! Il rend bien des services surtout sur Exchange (avec le Exchange Management Shell). Saviez vous que certaines commandes permettent de réaliser des actions qui sont impossible sur l'interface Web ?
Voici donc un script très simple à lancer en Powershell (Exchange Management Shell)
Pour arrêter les services
Get-service -name "msexchange*" -dependentservices | Where-Object {$_.Status -eq 'Running'} | Stop-Service
Pour Démarrer les services
Get-service -name "msexchange*" -dependentservices | Where-Object {$_.Status -eq 'stopped'} | Start-Service
Ces scripts fonctionnent pour Exchange 2010 - 2013 - 2016
Une fois lancé patientez et vous verrez les services démarrer un à un.
Exchange et script en .BAT
Une autre solution qui est moins universelle est de créer des scripts en .BAT . Fonctionne très bien pour Exchange 2010
Vous pouvez adapter ce script pour Exchange 2013 / 2016 vous pouvez inventorier chaque services Exchange dans la liste des services du serveur afin de les identifier.
Voici une commande pour lister l'ensemble des services Exchange :
A savoirGet-Service | Where {$_.DisplayName -Like « *Exchange* »} | ft DisplayName, Name, Status | tee -filePath c:\resultat.txt
Ce script affiche la liste des services Exchange ainsi que les statuts puis enregistre le résultat dans un fichier resultat.txt sur le c:\
Ainsi vous pouvez vous créer un script précis avec uniquement les services qui sont utilisés dans votre infrastructure.
Copiez collez le code dans un fichier texte que vous enregistrez en .BAT .
Pour Exchange 2010
Arrêt des services
Stop-Service MSExchangeAB
Stop-Service MSExchangeADTopology
Stop-Service MSExchangeAntispamUpdate
Stop-Service MSExchangeEdgeSync
Stop-Service MSExchangeFBA
Stop-Service MSExchangeFDS
Stop-Service MSExchangeIS
Stop-Service MSExchangeMailboxAssistants
Stop-Service MSExchangeMailboxReplication
Stop-Service MSExchangeMailSubmission
Stop-Service MSExchangeProtectedServiceHost
Stop-Service MSExchangeRepl
Stop-Service MSExchangeRPC
Stop-Service MSExchangeSA
Stop-Service MSExchangeSearch
Stop-Service MSExchangeServiceHost
Stop-Service MSExchangeThrottling
Stop-Service MSExchangeTransport
Stop-Service MSExchangeTransportLogSearch
Démarrage des services Exchanges
Start-Service MSExchangeAB
Start-Service MSExchangeADTopology
Start-Service MSExchangeAntispamUpdate
Start-Service MSExchangeEdgeSync
Start-Service MSExchangeFBA
Start-Service MSExchangeFDS
Start-Service MSExchangeIS
Start-Service MSExchangeMailboxAssistants
Start-Service MSExchangeMailboxReplication
Start-Service MSExchangeMailSubmission
Start-Service MSExchangeProtectedServiceHost
Start-Service MSExchangeRepl
Start-Service MSExchangeRPC
Start-Service MSExchangeSA
Start-Service MSExchangeSearch
Start-Service MSExchangeServiceHost
Start-Service MSExchangeThrottling
Start-Service MSExchangeTransport
Start-Service MSExchangeTransportLogSearch
Vous avez ainsi la possibilité de redémarrer, de maîtriser facilement vos redémarrages Exchange.
Si vous avez des scripts , des améliorations les commentaire sont là.
Commentaires
Laisser un commentaire