Applied to: Windows Server 2003, Windows Server 2003 R2, Windows Server 2003 with SP1
IIS automatically launches the Web site when it is created, unless the administrator explicitly prohibits it with the/dontstart parameter. An administrator may prevent automatic startup, for example, by allowing a site to be added to DNS for a certain amount of time.
The administrator may also suspend or stop the Web site for troubleshooting purposes. In similar cases, you can start or restart the Web site using the command-line script iisweb.vbs (stored in systemroot\system32).
Important matters
Only members of the Administrators group on the local computer can run scripts and executables. As a security best practice, log on to the computer using an account that is not part of the Administrators group, and then use the runas command to run scripts and executables as an administrator. At the command prompt, type runas/profile/user:mycomputer\administrator cmd, open a command window with administrator privileges, and then type Cscript.exescriptname (including the full path and any parameters of the script).
This topic includes the following information:
• Syntax: The order in which you type the command and any parameters and options that follow it.
• Parameter: Gives the value of the variable in the command.
• Example: Sample code and a description of the result.
Grammar
iisweb/start WebSite [WebSite ...] [/s Computer [/u [domain\]user/p Password]]
Parameters
WebSite
Required. Specify a site name or metabase path for 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 name or IP address of the computer without the backslash. By default, the script runs on the local computer.
/u [domain\]user
Runs the script with the permissions of the specified user account. The 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 for the user account specified in the/u parameter.
Example
Example 1:
The following example launches the Products Web site on the local computer. This command identifies the site with the site name. In this case, the/s parameter is ignored because the server is the local computer. The/U and/p parameters are ignored because the current user of the local computer must be logged on as an administrator to run the command.
Copy Code code as follows:
In response, IIsWeb displays the following message confirming that the site was started and identifying it with the site's metabase path:
Connecting to server ... Done.
Server w3svc/1977437537 has been started.
Example 2:
The following example launches the products and Marketing sites on the remote computer SVR01. This command uses its metabase path "w3svc/1509060225" to identify the site "products", using the name to identify the site "Marketing". In addition, the command uses the/s parameter to specify the remote computer, using the/U and/P parameters to run the command with the user's administrator account permissions.
Copy Code code as follows:
Iisweb/start w3svc/1509060225 marketing/s svr01/u alice/p p@# #word
In response, IIsWeb displays the following message confirming that the sites have been started and identifying them with the metabase path for each site:
Connecting to server ... Done.
Server w3svc/1509060225 has been started.
Server w3svc/1977437537 has been started.
Cloud Habitat Community Friendship Reminder:
How the above command cannot run can perform regsvr32 wshom.ocx.
We can also save the above command as a bat, and then execute it periodically through a scheduled task.