Iisweb.vbs: IIS
Web Site management script
This page is from Microsoft
Creates, deletes, and lists Web sites on servers running Windows
Server 2003 with Internet Information Services (IIS) 6.0. Also
starts, stops, and pauses the Web sites.
To view the command
syntax, click a command:
Creates Web sites on servers running Windows Server 2003 with
Internet Information Services (IIS) 6.0.
Syntax
iisweb[.vbs] /create PathSiteName [/b
Port] [/I IPAddress] [/d
HostHeader] [/dontstart] [/s Computer [/u
[Domain\]User [/p Password]]]
Parameters
Path
Required. Specifies the location of content files
for the Web site. The path must be local, such as
C:\Projects\HTML. If the specified path does not
exist, Iisweb.vbs creates the path.The Path
parameter must immediately precede the SiteName
parameter in the command. Otherwise, Iisweb.vbs does
not interpret the site information correctly.
SiteName
Required. Specifies a name for the Web site.
/bPort
Specifies a TCP port number for the Web site. The
default is 80.
/iIPAddress
Specifies an IP address for the Web site. If this
parameter is not specified, the default is All
Unassigned, which assigns to the site all of the IP
addresses on the computer that are not assigned to
other sites. Only one site on each IIS server can be
set to All Unassigned.
/dHostHeader
Specifies the host header name for 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 Web site does not start
automatically as soon as it is created. By default,
IIS starts the Web site when the /create
command completes successfully.
/sComputer
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.
/pPassword
Specifies the password of the user account specified
in the /u parameter. If you omit this
parameter, the script prompts you for the password
and obscures the text you type.
/?
Displays help at the command prompt.
Remarks
- To perform this procedure, you must be a member of the
Administrators group on the local computer, or you must have
been delegated the appropriate authority. If the computer is
joined to a domain, members of the Domain Admins group might be
able to perform this procedure. As a security best practice,
consider using Run as to perform this procedure.
- The Path parameter must immediately precede the
SiteName parameter in the command. Otherwise, Iisweb.vbs
does not interpret the 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 a Web site, and it does not 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 needed to create the site and
identify its contents. Iisweb.vbs uses the same default
properties that IIS uses when establishing new Web sites, and
adheres to the same rules for inheriting properties. To
configure the more advanced properties of the site, use IIS
Manager.
Examples
The following examples show how to use iisweb /create in
specific situations.
To create a Web site on the local computer
The following command creates the My Vacation Web site from
files stored in C:\Rome. It uses the /d parameter to
specify a host header for the Web site. It also uses the /dontstart
parameter so that the Web site does not start automatically.
This provides time to add the host header name to DNS before
starting the site.
iisweb /create C:\Rome "My Vacations" /d
www.reskit.com /dontstart
In response, Iisweb.vbs displays the basic properties of the
new Web site. The status is Stopped because the command
specified that the site should not start automatically.
Note that the metabase path that IIS generates for the new
Web site is composed of W3SVC and a randomly generated
identifier.
Connecting to server ...Done.
Server = IIS-TEST
Site Name = My Vacations
Metabase Path = W3SVC/1211348328
IP = ALL UNASSIGNED
Host = www.reskit.com
Port = 80
Root = C:\Rome
Status = STOPPED
To create a Web site on a remote computer
The following command creates the 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.
The command uses the /i parameter to specify an IP
address for the site. It uses the /s parameter to specify
the remote computer, and the /u and /p parameters
to run the script with the permissions of the user's
Administrator account.
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 Web 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
Deletes Web sites from servers running Windows Server 2003 with
Internet Information Services (IIS) 6.0. Also starts, stops, and
pauses the Web sites.
Syntax
iisweb[.vbs] {/delete | /start |
/stop | /pause} 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.
/sComputer
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.
/pPassword
Specifies the password of the user account specified
in the /u parameter. If you omit this
parameter, the script prompts you for the password
and obscures the text you type.
/?
Displays help at the command prompt.
Remarks
- To perform this procedure, you must be a member of the
Administrators group on the local computer, or you must have
been delegated the appropriate authority. If the computer is
joined to a domain, members of the Domain Admins group might be
able to perform this procedure. As a security best practice,
consider using Run as to perform this procedure.
Examples
The following examples show how to use iisweb /delete,
/start, /stop, and /pause in specific
situations.
To delete a Web site
The following command deletes the My First Novel Web site from
the local computer:
iisweb /delete "My First Novel"
In response, Iisweb.vbs displays a success message in which
it identifies the Web site by its metabase path,
W3SVC/409413479:
Server W3SVC/409413479 has been
DELETED.
To delete multiple Web sites on a remote computer
The following command deletes the Finance, Work Group, and Logo
Web sites from Svr01, a remote server. The command identifies
the Logo Web site by its metabase path, W3SVC/79116006.
iisweb /delete Finance "Work Group" W3SVC/79116006 /s Svr01
In response, Iisweb.vbs displays a success message in which
it identifies each Web site by its metabase path:
Connecting to server ...Done.
Server W3SVC/1977437537 has been DELETED.
Server W3SVC/1509060625 has been DELETED.
Server W3SVC/79116006 has been DELETED.
To restart a Web site on a remote computer
The following commands stop and then start the Products Web site
on the Srv01 remote computer. The commands identify the site by
its metabase path, W3SVC/1509060225. The 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 an administrator of
the remote computer.
iisweb /stop w3svc/1509060225 /s Srv01
iisweb /start w3svc/1509060225 /s Srv01
To pause and restart a Web site on a remote computer
The following commands pause and then restart the Marketing and
Finance Web sites on the Srv16 remote computer. The commands use
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
/pause Marketing Finance /s Srv16 /u Alice /p p@##word
iisweb /start Marketing Finance /s Srv16 /u Alice /p
p@##word
Displays the Web sites on servers running Windows Server 2003
with Internet Information Services (IIS) 6.0.
Syntax
iisweb[.vbs] /query [WebSite [WebSite...]][/s
Computer [/u [Domain\]User
[/p Password]]]
Parameters
WebSite
Limits the query to the specified Web site. Type the
name or metabase path of the Web site. The default
is to display all Web sites on the IIS server.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.
/sComputer
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.
/pPassword
Specifies the password of the user account specified
in the /u parameter. If you omit this
parameter, the script prompts you for the password
and obscures the text you type.
/?
Displays help at the command prompt.
Remarks
- To perform this procedure, you must be a member of the
Administrators group on the local computer, or you must have
been delegated the appropriate authority. If the computer is
joined to a domain, members of the Domain Admins group might be
able to perform this procedure. As a security best practice,
consider using Run as to perform this procedure.
Examples
The following examples show how to use iisweb /query in
specific situations.
To query the Web sites on the local computer
The following command displays the Web sites on the local
computer:
iisweb /query
In response, Iisweb.vbs displays all of the IIS Web sites on
the local computer:
Site Name (Metabase Path)Status IP Port Host
=======================================================
Default Web Site (W3SVC/1) STARTED ALL 90 N/A
Products (W3SVC/1948497947) STARTED 172.30.163.244 80 N/A
Finance (W3SVC/1211348328) STARTED 172.30.152.249 80 N/A
Marketing (W3SVC/1907510956) STARTED ALL 95 www.reskit.com
To query a specific Web site on a remote computer
The following command searches for the Marketing Web site on the
Srv01 remote computer. It uses the /s parameter to
specify the remote computer and the /u and /p
parameters to run the script with the permissions of the user's
Administrator account.
iisweb /query Marketing /s Srv01 /u
Admin6 /p A76QVJ32#
In response, Iisweb.vbs displays the Marketing Web site on
Srv01:
Site Name (Metabase Path) Status IP
Port Host
===================================================
Marketing (W3SVC/1907510956) STOPPED ALL
To query multiple Web sites
The following command displays the status of the Marketing and
Finance Web sites on the local computer. It uses site names to
identify the Web sites, although metabase paths are also valid.
iisweb /query Marketing Finance
In response, Iisweb.vbs displays the Marketing and Finance
Web sites:
Site Name (Metabase Path) Status IP
Port Host
======================================================
Marketing (W3SVC/1907510956) STARTED ALL
80 www.reskit.com
Finance (W3SVC/1509060625) STARTED 192.168.125.225 80
Remarks
- Iisweb.vbs performs the same operations that are available
from IIS Manager. You can use either tool to administer IIS Web
sites.
- The computer issuing the command must be running Windows XP
or a Windows Server 2003 operating system. The user must be a
member of the Administrators group on any computer that the
command affects.
- The computer that the command affects must be a server
running Windows Server 2003 with Internet Information Services
(IIS) 6.0.
- Iisweb.vbs displays a "Connecting to server" message while
it connects to the IIS service on the specified computer. This
message appears whenever you use Iisweb.vbs, whether on a local
or a remote computer.
Formatting legend
Italic |
Information that the user must supply |
Bold |
Elements that the user must type exactly as shown |
Ellipsis (...) |
Parameter that can be repeated several times in a
command line |
Between brackets ([]) |
Optional items |
Between braces ({}); choices separated by pipe (|).
Example: {even|odd} |
Set of choices from which the user must choose only
one |
Courier font |
Code or program output |
|
|