'web'에 해당되는 글 2건

  1. 2009.03.05 Stop a Web Server
  2. 2009.03.05 Start a Web Server
2009. 3. 5. 13:37

Stop a Web Server

출처 : http://www.microsoft.com/technet/scriptcenter/scripts/sus/default.mspx?mfr=true

Stop a Web Server

Description

Stops an IIS Web server named W3SVC/2142295254.

Supported Platforms

Windows Server 2003

Yes

Windows XP

No

Windows 2000

No

Windows NT 4.0

No

Windows 98

No

Script Code

strComputer = "."
Set objWMIService = GetObject _
    ("winmgmts:{authenticationLevel=pktPrivacy}\\" _
        & strComputer & "\root\microsoftiisv2")

Set colItems = objWMIService.ExecQuery _
    ("Select * From IIsWebServer Where Name = " & _
        "'W3SVC/2142295254'")

For Each objItem in colItems
    objItem.Stop
Next


실행 방법
상기 스크립트를 StopWebSite.vbs 파일로 생성하고,
c:\>cscript StopWebSite.vbs
와 같이 실행한다.

또는 배치파일에서 호출한다.
2009. 3. 5. 13:35

Start a Web Server

출처 : http://www.microsoft.com/technet/scriptcenter/scripts/sus/default.mspx?mfr=true

Start a Web Server

Description

Starts an IIS Web server named W3SVC/2142295254.

Supported Platforms

Windows Server 2003

Yes

Windows XP

No

Windows 2000

No

Windows NT 4.0

No

Windows 98

No

Script Code

strComputer = "."
Set objWMIService = GetObject _
    ("winmgmts:{authenticationLevel=pktPrivacy}\\" _
        & strComputer & "\root\microsoftiisv2")

Set colItems = objWMIService.ExecQuery _
    ("Select * From IIsWebServer Where Name = " & _
        "'W3SVC/2142295254'")

For Each objItem in colItems
    objItem.Start
Next


실행 방법
상기 스크립트를 StartWebSite.vbs 파일로 생성하고,
c:\>cscript StartWebSite.vbs
와 같이 실행한다.

또는 배치파일에서 호출한다.