Compartilhar via


Site.Stop Method [IIS 7 and higher]

Stops a currently running Web site.

Syntax

oSite.Stop
oSite.Stop();

Parameters

This method takes no parameters.

Return Value

This method does not return a value.

Remarks

This method is new to the IIS 7 WMI provider and has no counterpart in IIS 6.0.

Example

The following example stops the Web site named IISWebSite.

' Connect to the WMI WebAdministration namespace.
Set oWebAdmin = GetObject("winmgmts:root\WebAdministration")

' Specify the Web site name.
Set oSite = oWebAdmin.Get("Site.Name='IISWebSite'")

' Stop the Web site.
oSite.Stop

To check the state of the Web site after you call the Stop method, use the GetState method.

Requirements

Type

Description

Client

Requires IIS 7 on Windows Vista.

Server

Requires IIS 7 on Windows Server 2008.

Product

IIS 7

MOF file

WebAdministration.mof

See Also

Reference

Site Class [IIS 7 and higher]

Site.GetState Method [IIS 7 and higher]

Site.Start Method [IIS 7 and higher]