Stopping Web Sites Using Iisweb.vbs

Applies To: Windows Server 2003, Windows Server 2003 R2, Windows Server 2003 with SP1

If your Web site is not behaving as expected, or if the site is slow or unresponsive, stopping and restarting the site might clear a temporary problem with the software—for example, a faulty worker process.

In cases like these, you can use the command-line script iisweb.vbs, which is stored in systemroot\System32, to stop a Web site from responding. The content of the site is unchanged, but it will be inaccessible to users until the site is restarted.

Important

You must be a member of the Administrators group on the local computer to run scripts and executables. As a security best practice, log on to your computer by using an account that is not in the Administrators group, and then use the runas command to run your script or executable as an administrator. At a command prompt, type runas /profile /User:MyComputer</STRONG>Administrator cmd to open a command window with administrator rights and then type cscript.exe ScriptName (include the script's full path and any parameters).

This topic includes the following information:

  • Syntax: The order in which you type a command and any arguments and options that follow it.

  • Parameters: The values that are given to variables in the command.

  • Examples: Sample code and an explanation of the results.

Syntax

iisftp/stop WebSite [WebSite...] [/s Computer [/u [Domain\]User**/p** Password]]

Parameters

WebSite

Required. Specifies the site name or metabase path of the Web site. Web sites must be uniquely identified. If more than one Web site has the same descriptive name, you must use the metabase path to identify the Web site.

/s Computer

Runs the script on the specified remote computer. Type the computer name or IP address without backslashes. By default, the script runs on the local computer.

/u [Domain\]User

Runs the script with the permissions of the specified user account. This account must be a member of the Administrators group on the remote computer. By default, the script runs with the permissions of the current user of the local computer.

/p Password

Specifies the password of the user account that is specified in the /u parameter.

Examples

Example 1:

The following example stops the "Products" Web site on the local computer. The command identifies the site by its name. In this example, the /s parameter is unnecessary because the server is local. The /u and /p parameters are omitted because the current user of the local computer must be logged on as an administrator in order to run the command.

iisweb /stop Products

In response, iisweb displays the following message confirming that the site has been stopped, and identifying it by its metabase path:

Connecting to server ...Done.

Server W3SVC/1977437537 has been STOPPED.

Example 2:

The following example stops the "Products" and "Marketing" Web sites on the SVR01 remote computer. The command identifies the "Products" site by its metabase path, "W3SVC/1509060225", and the "Marketing" site by name. In addition, the command uses the /s parameter to specify the remote computer, and the /u and /p parameters to run the commands with the permissions of the user's administrator account.

iisweb /stop w3svc/1509060225 Marketing /s SVR01 /u Alice /p p@##word

In response, iisweb displays the following message confirming that the sites have been stopped, and identifying each by its metabase path:

Connecting to server ...Done.

Server W3SVC/1509060225 has been STOPPED.

Server W3SVC/1977437537 has been STOPPED.

For information about creating Web site configurations, see Creating Web Sites in IIS 6.0.

For information about deleting Web site configurations, see Deleting Web Sites Using Iisweb.vbs.

For information about listing Web site configurations, see Listing Web Sites Using Iisweb.vbs.

For information about starting Web sites, see Starting Web Sites Using Iisweb.vbs.

For information about pausing Web sites, see Pausing Web Sites Using Iisweb.vbs.