Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use iisweb.vbs iis sites to manage scripts

2025-04-09 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly explains "how to use iisweb.vbs iis site management script", the content of the article is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn "how to use iisweb.vbs iis site management script" bar!

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

Iisweb.vbs:IIS site Administration script

Create, delete, and list Web sites on a server running Windows Server 2003 with Internet Information Services (IIS) 6.0. You can also start, stop, and pause the site.

Iisweb.vbs (usually in systemroot\ System32) can be downloaded if not available.

To view the command syntax, click the following command:

Iisweb / create

Iisweb / delete, / start, / stop, / pause

Iisweb / query

Iisweb / create

Create a Web site on a server running Windows Server 2003 with Internet Information Services (IIS) 6.0.

Grammar

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

Parameters.

Path

Required parameters. Specify the location of the content file for the site. 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 precede the SiteName parameter immediately. Otherwise, Iisweb.vbs will not be able to interpret site information correctly.

SiteName

Required parameters. Specify the name of the website.

/ b Port

Specifies the TCP port number of the Web site. The default value is 80.

/ i IPAddress

Specify the IP address of the website. If this parameter is not specified, the default value is all unassigned, which assigns all IP addresses on computers that are not assigned to another site to that site. Only one site on each IIS server can be set to all unassigned.

/ d HostHeader

Specify the host header name of the Web site, 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 site will not start automatically immediately after creation. By default, IIS launches the Web site when the / create command completes successfully.

/ s Computer

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

/ u [Domain\] User

Runs the script with the privileges 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 privileges of the current user on the local computer.

/ p Password

Specifies the password for the user account specified in the / u parameter. If you omit this parameter, the script prompts you for a password and does not display the text you typed.

/?

Displays help at the command prompt.

Annotation

To perform this process, you must be a member of the Administrators group on the local computer, or you must be delegated the appropriate permissions. If the computer is joined to a domain, members of the Domain Admins group may perform this process. As the safest operation, consider using run mode to perform this process.

In the command, the Path parameter must precede the SiteName parameter immediately. Otherwise, Iisweb.vbs will not be able to interpret site information correctly.

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 port number, IP address, or host header of the site, nor does it verify that these bindings are unique within the server. If you create a site with invalid or conflicting bindings, the site will not start.

When you use Iisweb.vbs to create a new Web site, you specify only the basic properties required to create the site and identify its content. The default properties used by Iisweb.vbs are the same as those used by IIS when creating a new Web site, and conform to the rules for inheriting properties. To configure more advanced properties of the site, use IIS Manager.

Example

The following example shows how to use iisweb / create in specific situations.

Create a Web site on the local computer

The following command creates a My Vacation site using files stored in C:\ Rome. It uses the / d parameter to specify the host header of the site. It also uses the / dontstart parameter so that the Web site does not start automatically. This gives the system enough time to add the host header name to the DNS before starting the site.

The copy code is as follows:

Iisweb / create d:\ webroot\ jb51 "jb51" / d www.jb51.net / dontstart

In response, Iisweb.vbs displays the basic properties of the new site. Because the command specifies that the site should not start automatically, the status is stopped.

Note that the configuration database path generated by IIS for the new Web site consists of W3SVC and randomly generated identifiers.

Connecting to the server. Done. 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 Web site on a remote computer

The following command creates a Marketing Web site 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 the / u and / p parameters to run the script with the user's administrator account privileges.

The copy 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 properties of the new site:

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

Remove the Web site from the server running Windows Server 2003 with Internet Information Services (IIS) 6.0. You can also start, stop, and pause the site.

Grammar

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

Parameters.

WebSite

Required parameters. Specify the site name or configuration database path for the site.

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

/ s Computer

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

/ u [Domain\] User

Runs the script with the privileges 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 privileges of the current user on the local computer.

/ p Password

Specifies the password for the user account specified in the / u parameter. If you omit this parameter, the script prompts you for a password and does not display the text you typed.

/?

Displays help at the command prompt.

Annotation

To perform this process, you must be a member of the Administrators group on the local computer, or you must be delegated the appropriate permissions. If the computer is joined to a domain, members of the Domain Admins group may perform this process. As the safest operation, consider using run mode to perform this process.

Example

The following example shows how to use iisweb / delete, / start, / stop, and / pause in specific situations.

Delete a website

The following command removes the My First Novel Web site from the local computer:

The copy code is as follows:

Iisweb / delete "My First Novel"

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

Server W3SVC/409413479 has been DELETED.

Delete multiple Web sites on a remote computer

The following command removes the Finance, Work Group, and Logo Web sites from the remote server Svr01. This command will identify the Logo Web site by its configuration database path W3SVC/79116006.

The copy code is as follows:

Iisweb / delete Finance "Work Group" W3SVC/79116006 / s Svr01

In response, Iisweb.vbs will display a success message where it will identify each website by configuring the database path:

Copy

Connecting to the server. Done. Server W3SVC/1977437537 has been DELETED . Server W3SVC/1509060625 has been DELETED.Server W3SVC/79116006 has been DELETED.

Restart the Web site on the remote computer

The following command stops the Products Web site 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.

The copy code is as follows:

Iisweb / stop w3svc/1509060225 / s Srv01

Iisweb / start w3svc/1509060225 / s Srv01

Pause and restart a Web site on a remote computer

The following command pauses the Marketing and Finance Web sites on the remote computer Srv16 before starting them. This command uses the / s parameter to specify the remote computer and the / u and / p parameters to run these commands with the privileges of the user's administrator account.

The copy code is as follows:

Iisweb / pause Marketing Finance / s Srv16 / u Alice / p p@##word

Iisweb / start Marketing Finance / s Srv16 / u Alice / p p@##word

Iisweb / query

Displays the Web site on a server running Windows Server 2003 with Internet Information Services (IIS) 6.0.

Grammar

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

Parameters.

WebSite

Limits the query to the specified Web site. Please type the name of the Web site or the configuration database path. The default value is to display all sites on the IIS server.

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

/ s Computer

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

/ u [Domain\] User

Runs the script with the privileges 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 privileges of the current user on the local computer.

/ p Password

Specifies the password for the user account specified in the / u parameter. If you omit this parameter, the script prompts you for a password and does not display the text you typed.

/?

Displays help at the command prompt.

Annotation

To perform this process, you must be a member of the Administrators group on the local computer, or you must be delegated the appropriate permissions. If the computer is joined to a domain, members of the Domain Admins group may perform this process. As the safest operation, consider using run mode to perform this process.

Example

The following example shows how to use iisweb / query in specific situations.

Query the website on the local computer

The following command displays the Web site on the local computer:

Iisweb / query

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

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

Query specific Web sites on remote computers

The following command searches the Marketing Web site on the remote computer Srv01. It uses the / s parameter to specify the remote computer and the / u and / p parameters to run the script with the privileges of the user's 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 status of the Marketing and Finance Web sites on the local computer. Although the configuration database path is also valid, it still uses the site name to identify the site.

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

Annotation

Iisweb.vbs can do the same thing through the IIS Manager. You can use any of these tools to manage IIS sites.

The computer that issued the command must be running the Windows XP or Windows Server 2003 operating system. 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 2003 with Internet Information Services (IIS) 6.0.

When you connect to the IIS service on the specified computer, Iisweb.vbs displays a "connecting to server" message. This message is displayed every time you use Iisweb.vbs, whether on a local or remote computer.

Thank you for your reading, the above is the content of "how to use iisweb.vbs iis website management script", after the study of this article, I believe you have a deeper understanding of how to use iisweb.vbs iis website management script, the specific use of the situation also needs to be verified by practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report