Friday, December 26, 2008

How to Start, Stop and Pause a Web Server on IIS using VBScript?

Here is a VBScript code to start, stop and pause a web server running in IIS:

Start a Web Server

strComp = "LocalHost"
Set objIIS = GetObject("IIS://" & strComp & "/W3SVC/2142295254")
objIIS.Start

Stop a Web Server

strComp = "LocalHost"
Set objIIS = GetObject("IIS://" & strComp & "/W3SVC/2142295254")
objIIS.Stop


Pause a Web Server

strComp = "LocalHost"
Set objIIS = GetObject("IIS://" & strComp & "/W3SVC/2142295254")
objIIS.Pause

Hope this helps :)

0 comments:

Post a Comment