Stop/Start des services à distance.

Posted by on May 28, 2011 in Windows

Arrêter et démarrer un service sur un serveur à distance.
Dans l’exemple, je traite le service « Microsoft Exchange Replication Service ».

Stop:

$Svc = Get-WmiObject -Computer SRV001 win32_service  -Filter "name='MSExchangeRepl'"
$Result = $Svc.StopService()
$Result.ReturnValue

Start:

$Svc = Get-WmiObject -Computer SRV001 win32_service  -Filter "name='MSExchangeRepl'"
$Result = $Svc.StartService()
$Result.ReturnValue

Post a Reply

Your email address will not be published. Required fields are marked *