Friday, February 23, 2007

Stop and Start Specific Websites

Ran into this really useful bit of VBS to stop or start specific websites in IIS:

To Stop (StopSite1.vbs):

Set IISObj=GetObject("IIS://LocalHost/W3SVC/1")
IISObj.Stop

To Start (StartSite1.vbs):

Set IISObj=GetObject("IIS://LocalHost/W3SVC/1")
IISObj.Start

Just copy the lines into a text file, rename to .vbs and run with: cscript StartSite1.vbs or cscript StopSite1.vbs.

No comments: