Iisweb. vbs iis website management script usage introduction, iisweb. vbs website management

Source: Internet
Author: User
Tags metabase

Iisweb. vbs iis website management script usage introduction, iisweb. vbs website management

Application to: Windows Server 2003, Windows Server 2003 R2, Windows Server 2003 with SP1, Windows Server 2003 with SP2

Iisweb. vbs: IIS website management script

Create, delete, and list websites on a Server running Windows Server 6.0 with Internet Information Service (IIS) 2003. You can also start, stop, or pause a website.

Iisweb. vbs (usually in systemroot \ System32.

To view the command syntax, click the following command:

• Iisweb/create
• Iisweb/delete,/start,/stop,/pause
• Iisweb/query

Iisweb/create
Create a website on a Server running Windows Server 6.0 with Internet Information Service (IIS) 2003.

Syntax
Iisweb [. vbs]/create PathSiteName [/B Port] [/I IPAddress] [/d HostHeader] [/dontstart] [/s Computer [/u [Domain \] User [/p Password]

Parameters
Path
Required parameter. Specifies the location of the website's content file. The path must be a local path, such as C: \ Projects \ HTML. If the specified path does not exist, Iisweb. vbs creates the path.

In the command, the Path parameter must be placed before the SiteName parameter. Otherwise, Iisweb. vbs cannot correctly interpret site information.
SiteName
Required parameter. The name of the specified website.

/B Port
Specifies the TCP port number of the website. The default value is 80.

/I IPAddress
The IP address of the specified website. If this parameter is not specified, the default value is "all unallocated". This will allocate all IP addresses on computers not allocated to other sites to the site. Only one site on each IIS server can be set to "all unallocated ".

/D HostHeader
Specifies the Host header name of the website, such as www.microsoft.com. By default, the site does not have a Host header name and must be identified by its IP address or port number.

/Dontstart
Indicates that the website will not be automatically started immediately after it is created. By default, IIS starts the website when the/create Command is successful.

/S Computer
Run the script on the specified remote computer. Enter a computer name or IP address without a backslash. By default, scripts run on local computers.

/U [Domain \] User
Run the script with the permissions of the specified user account. This account must be a member of the Administrators group on a remote computer. By default, scripts are run with the permissions of the current user on the local computer.

/P Password
Specify the password of the user account specified in the/u parameter. If this parameter is ignored, the script prompts you to enter the password without displaying the entered text.

/?
Display help at a command prompt.

Note

• To perform this process, you must be a member of the Administrators group on the local computer, or you must be granted the corresponding permissions. If the computer has joined a Domain, members of the Domain Admins group may execute this process. For the most secure operation, use the "running mode" to perform this process.


• In the command, the Path parameter must be placed before the SiteName parameter. Otherwise, Iisweb. vbs cannot correctly interpret site information.
• DNS must be configured to associate the Host header name with the Internet server. Otherwise, the site will not start.
• Iisweb. vbs does not verify the website port number, IP address, or Host Header, nor does it verify that these bindings are unique within the server. If an invalid or conflicting binding is used to create a site, the site will not start.
• When you use Iisweb. vbs to create a new website, you only need to specify the basic attributes required to create the site and identify its content. The default attributes used by Iisweb. vbs are the same as those used by IIS when a new website is created and comply with the rules of the inherited attributes. To configure more advanced properties for the site, use the IIS manager.


Example
The following example shows how to use iisweb/create under specific circumstances.

Create a website on a local computer
The following command creates a My Vacation website using a file stored in C: \ Rome. It uses the/d parameter to specify the Host header of the website. It also uses the/dontstart parameter so that the website will not start automatically. In this way, the system has enough time to add the Host header name to DNS before starting the site.

Copy codeThe Code is as follows:
Iisweb/create d: \ webroot \ jb51 "jb51"/d www.jb51.net/dontstart

In response, Iisweb. vbs displays the basic attributes of the new website. Because this command specifies that the website should not be started automatically, the status is "STOPPED ".

Note that the configuration database path generated by IIS for the new website consists of W3SVC and a randomly generated identifier.

 
Connecting to the server... finished. Server = IIS-TEST Site Name = My Vacations Metabase Path = W3SVC/1211348328 IP = all unassigned Host = www.jb51.net Port = 80 Root = C: \ Rome Status = STOPPED
Create a website on a remote computer
The following command creates a Marketing website on the Srv01 remote server. It associates the site with files stored in the D: \ New Initiatives \ Marketing \ HTMFiles directory on Srv01. This command uses the/I parameter to specify the IP address of the site. It uses the/s parameter to specify the remote computer and uses the/u and/p parameters to run the script with the Administrator account permission.

Copy codeThe Code is as follows:
Iisweb/create "D: \ New Initiatives \ Marketing \ HTMFiles" Marketing/I 172.30.163.244/s Srv01/u Admin6/p A76QVJ32 #

In response, Iisweb. vbs displays the basic attributes of the new website:

Server = SRV01 Site Name = Marketing Metabase Path = W3SVC/1907510956 IP = 172.30.163.244 Host = not specified Port = 80 Root = D: \ New Initiatives \ Marketing \ HTMFiles Status = STARTED
Iisweb/delete,/start,/stop,/pause

Delete A website from a Server running Windows Server 6.0 with Internet Information Service (IIS) 2003. You can also start, stop, or pause a website.

Syntax

Iisweb [. vbs] {/delete |/start |/stop |/pause} WebSite [WebSite...] [/s Computer [/u [Domain \] User [/p Password]

Parameters
WebSite
Required parameter. Specify the website name or configure the database path.

The website must be uniquely identified. If multiple websites have the same descriptive name, you must use the configured database path to identify the website.

/S Computer
Run the script on the specified remote computer. Enter a computer name or IP address without a backslash. By default, scripts run on local computers.

/U [Domain \] User
Run the script with the permissions of the specified user account. This account must be a member of the Administrators group on a remote computer. By default, scripts are run with the permissions of the current user on the local computer.

/P Password
Specify the password of the user account specified in the/u parameter. If this parameter is ignored, the script prompts you to enter the password without displaying the entered text.

/?
Display help at a command prompt.

Note
• To perform this process, you must be a member of the Administrators group on the local computer, or you must be granted the corresponding permissions. If the computer has joined a Domain, members of the Domain Admins group may execute this process. For the most secure operation, use the "running mode" to perform this process.

Example

The following example shows how to use iisweb/delete,/start,/stop, And/pause under specific circumstances.

Delete website

The following command deletes the My First Novel website from a local computer:

Copy codeThe Code is as follows:
Iisweb/delete "My First Novel"

As a response, Iisweb. vbs displays a success message, which identifies the website by configuring the database path W3SVC/409413479:

Server W3SVC/409413479 has been DELETED.

Delete multiple websites on a remote computer
The following command deletes Finance, Work Group, and Logo websites from the remote server Svr01. This command identifies the Logo website by configuring the database path W3SVC/79116006.

Copy codeThe Code is as follows:
Iisweb/delete Finance "Work Group" W3SVC/79116006/s Svr01

In response, Iisweb. vbs displays a success message, which identifies each website by configuring the database path:

Copy
Connecting to the server... finished. Server W3SVC/1977437537 has been DELETED. Server W3SVC/1509060625 has been DELETED. Server W3SVC/79116006 has been DELETED.
Restart a website on a remote computer
The following command stops the Products website on the remote computer Srv01 and then starts it. These commands will identify the site by configuring the database path W3SVC/1509060225. These commands use the/s parameter to specify the remote computer. In this example, the/u and/p parameters are omitted because the current user of the local computer is also the administrator of the remote computer.

Copy codeThe Code is as follows:
Iisweb/stop w3svc/1509060225/s Srv01
Iisweb/start w3svc/1509060225/s Srv01

Pause and restart a website on a remote computer
The following command pauses the Marketing and Finance websites on the remote computer Srv16 and then starts them. This command uses the/s parameter to specify the remote computer and uses the/u and/p parameters to run these commands with the permissions of the user administrator account.

Copy codeThe Code is as follows:
Iisweb/pause Marketing Finance/s Srv16/u Alice/p @ # word
Iisweb/start Marketing Finance/s Srv16/u Alice/p @ # word

Iisweb/query
Displays the websites running on Windows Server 6.0 servers with Internet Information Service (IIS) 2003.

Syntax
Iisweb [. vbs]/query [WebSite [WebSite...] [/s Computer [/u [Domain \] User [/p Password]

Parameters
WebSite
Restrict the query to the specified website. Enter the website name or configure the database path. The default value is to display all websites on the IIS server.

The website must be uniquely identified. If multiple websites have the same descriptive name, you must use the configured database path to identify the website.

/S Computer
Run the script on the specified remote computer. Enter a computer name or IP address without a backslash. By default, scripts run on local computers.

/U [Domain \] User
Run the script with the permissions of the specified user account. This account must be a member of the Administrators group on a remote computer. By default, scripts are run with the permissions of the current user on the local computer.

/P Password
Specify the password of the user account specified in the/u parameter. If this parameter is ignored, the script prompts you to enter the password without displaying the entered text.

/?
Display help at a command prompt.

Note
• To perform this process, you must be a member of the Administrators group on the local computer, or you must be granted the corresponding permissions. If the computer has joined a Domain, members of the Domain Admins group may execute this process. For the most secure operation, use the "running mode" to perform this process.


Example
The following example shows how to use iisweb/query under specific circumstances.

Query websites on a local computer
The following command displays the website on the local computer:

Iisweb/query

In response, Iisweb. vbs displays all IIS websites on the local computer:

Site Name (Metabase Path) status IP Port Host ========================================== ========================================================== = default website (W3SVC/1) started all 90 N/A Products (W3SVC/1948497947) STARTED 172.30.163.244 80 N/A Finance (W3SVC/1211348328) STARTED limit 80 N/A Marketing (W3SVC/1907510956) started all 95 www.jb51.net

Query specific websites on a remote computer

The following command searches for the Marketing website on the remote computer Srv01. It uses the/s parameter to specify the remote computer and uses the/u and/p parameters to run the script with the permissions of the user administrator account.

Iisweb/query Marketing/s Srv01/u Admin6/p A76QVJ32 #

In response, Iisweb. vbs displays the Marketing website on Srv01:

Site Name (Metabase Path) status IP Port Host ========================================== ========================================================== = Marketing (W3SVC/1907510956) stopped all 80 www.jb51.net

Query multiple websites

The following command displays the statuses of the Marketing and Finance websites on the local computer. Although the configuration of the database path is also valid, it still uses the site name to identify the website.

Iisweb/query Marketing Finance

In response, Iisweb. vbs displays the Marketing and Finance websites:

Site Name (Metabase Path) status IP Port Host ========================================== ========================================================== = Marketing (W3SVC/1907510956) started all 80 www.jb51.net Finance (W3SVC/1509060625) STARTED 192.168.125.225 80 www.reskit2.com

Note

• Iisweb. vbs can perform the same operations through the IIS manager. You can use any of the tools to manage the IIS website.

• The computer that sends the command must be running Windows XP or Windows Server 2003. The user must be a member of the Administrators group on the computer affected by the command.
• The computer affected by the command must be a Server running Windows Server 6.0 with Internet Information Service (IIS) 2003.
• When you connect to the IIS service on the specified computer, the Iisweb. vbs will display the message "connecting to the server. This message is displayed every time you use Iisweb. vbs, whether on a local computer or a remote computer.


Iiswebvbs

Iisweb. vbs can be used to manage IIS websites. Create a Website: describes how to create a website configuration on a local or remote computer by using iisweb. vbs. Delete a Website: describes how to use iisweb.
 
Due to IIS problems, some of my website scripts cannot be executed. Why?

1. enable Active Service Pages in "web Server Extension" of iis. A green check box is displayed after the Service is successfully enabled ~

2. check whether the execution permission in the "main directory" in IIS settings is "Pure script" and whether your website is in NTFS format on the disk, yes. Check whether the EVERYONE user group has the read and write permissions on the folder where the website is located. If there is a database, you must have the write permission.

You can try Step 1 first, and then test whether the program can run normally. If there is still a problem, use step 2 ~

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.