Jul 032012
 

Stopping Services Remotely with PowerShell

Stop-Service cannot stop services remotely. One easy way of doing so is Set-Service:

Set-Service-NameSpooler-Status“Stopped”-ComputerNametargetcomputer

However, unlike Stop-Service, Set-Service has no -Force parameter, so you cannot stop services if they, for example, have running dependent services.

If your infrastructure supports PowerShell Remoting, you could use Invoke-Command instead:

Invoke-Command { Stop-Service-NameSpooler-Force } -ComputerNametargetcomputer

Leave a Reply