Tuesday, June 22, 2010

Start Stop IIS7 or Any Other Service With Powershell

The IIS7 service can be controlled via Powershell using the following commandline.

(Get-WmiObject Win32_Service -Filter "Name='w3svc'").InvokeMethod("StopService",$null)

Use StopService to stop the service and StartService to start the service.

Use any other service name instead of w3svc to start or stop an arbitrary service.
Post a Comment