Use of IIS management script adsutil. vbs

Source: Internet
Author: User
Tags iis administration metabase
What is adsutil. vbs? It is a command-line-based IIS management script provided by IIS in Windows 2003, 95,426 bytes in the % systemdrive % \ Inetpub \ adminscripts directory. Such a large script is certainly very powerful at first glance, and the truth is also true. I think it is an "Internet Information Service Manager" under the command line (in fact, Windows 2000 uses more than 20 original vbs under % systemdrive % \ Inetpub \ adminscripts for management, in 2003, only adsutil is left. vbs is enough to show how powerful its functions are ).

Adsutil. vbs has to mention metabase. bin. This file is the most important configuration file for IIS. All IIS settings will be stored in this file, IIS manager and adsutil. vbs displays the configuration information of this file to the user. Its storage structure is very similar to the Registry and is a tree-type storage structure. IIS manager and adsutil. vbs uses an adspath path to access metabase. bin. The path starts with IIS :\\. localhost indicates the local server, and W3SVC indicates the IIS service, such as IIS: \ localhost/w3svc/1 indicates the first web site on the local server, IIS: \ localhost/w3svc/1/root/vdir indicates the vdir virtual directory under the root directory of the first web site.
Adsutil. vbs basic usage

With this knowledge, let's go back to adsutil. vbs to see its usage:

C: \ Inetpub \ adminscripts> cscript adsutil. vbs
Microsoft (r) Windows Script Host version 5.6
Copyright (c) Microsoft Corporation 1996-2001. All rights reserved.
Usage:
Adsutil. vbs <cmd> [<path> [<value>]
Description:
IIS administration utility that enables the configuration of metabase Properties
Supported commands: // supported commands. This is the most important
Get, set, Enum, delete, create, copy, appcreateinproc, appcreateoutproc, appcreatepoolproc, appdelete, appunload, appgetstatus

Configure Directory Access Permissions

C: \ Inetpub \ admins cripts> chaccess. vbs-A w3svc/1/root-verbose
Usage: chaccess <-- adspath |-A adspath> controls the configuration path.
[-- Computer |-C computer1 [, computer2. ..] specifies the machine name and IP address.
[+ Read |-read] read permission in the main directory
[+ Write |-write] write permission in the main directory
The execution permission in the [+ S privileges |-s privileges] main directory is script-only.
[+ Execute |-Execute] The execution permission in the main directory is script and executable.Program
[+ Browse |-browse] directory browsing permission in the main directory
[-- Verbose |-v] current version
[-- Help |-?]

Displays the attributes and status information of a specified path.

C: \ Inetpub \ admins cripts> dispnode help
Usage: dispnode <-- adspath |-A ads path of node> [-- help |-H]
ADS path-the path of the node to be displayed
Example 1: dispnode-a iis: // localhost/W3SVC displays the main attributes of the current IIS
Example 2: dispnode -- adspath IIS: // machinename/w3svc/1 displays the status information of the current site
Search for the named Web and display the node number, description, host name, port, and IP address
C: \ Inetpub \ admins cripts> findweb
Web site number = 1
Web site des cription = default web site
Hostname =
Port = 80
IP address =
C: \ Inetpub \ admins cripts> findweb m7.net
Web site number = 2
Web site des cription = m7.net
Hostname = www.m7.net
Port = 80
IP address = www.m7.net

Displays the Path Management tree of a specified site.

C: \ Inetpub \ admins cripts> disptree. vbs help
Usage: disptree [-- adspath |-a root node] specifies the path to display the management tree
[-- Norecurse |-N]
[-- Help |-?]

Create a WEB virtual site

C: \ Inetpub \ admins cripts> mkw3site help
Unknown argument help
Usage: mkw3site <-- rootdirectory |-r root directory> website path name
<-- Comment |-T server comment> Web site ID
[-- Computer |-C computer1 [, computer2. ..]
[-- Port |-O port num] Port
[-- IPaddress |-I ip address] IP Address
[-- Hostname |-H host name] Host Name
[-- Sitenumber |-N sitenumber]
[-- Dontstart] does not start
[-- Verbose |-v]
[-- Help |-?]

Create a virtual directory for the specified site

C: \ Inetpub \ admins cripts> mkwebdir. vbs help
Usage: mkwebdir [-- computer |-C computer1, computer2] specify the server name
<-- Website |-W website1> specifies the virtual site name.
<-- Virtualdir |-V name1, path1, name2, path2,...> specify the virtual directory name and directory file address
[-- Help |-?]
Example: mkwebdir-C mycomputer-W "Default web site"
-V "dir1", "C: \ Inetpub \ wwwroot \ dir1", "dir2", "C: \ Inetpub \ wwwroot \ dir2"

Suspend the IIS service of the specified site

C: \ Inetpub \ admins cripts> pausesrv help
Usage: pausesrv <-- adspath |-A server1 [, server2, server3. ..]>
[-- Computer |-C computer1 [, computer2. ..]
[-- Verbose |-v]
[-- Help |-?]
Example 1: pausesrv-A w3svc/1, msftpsvc/2
Example 2: pauseftp-C machine1, machine2, machine3-A w3svc/1, msftpsvc/2

Resume the IIS service of the paused site

C: \ Inetpub \ admins cripts> contsrv. vbs help
Usage: contsrv <-- adspath |-A server1 [, server2, server3. ..]>
[-- Computer |-C computer1 [, computer2. ..]
[-- Verbose |-v]
[-- Help |-?]
Example 1: contsrv-A w3svc/1, msftpsvc/2
Example 2: contsrv-C machine1, machine2, machine3-A w3svc/1, msftpsvc/2

Same as above
Pauseftp. vbs pause the FTP Server Service
Contftp. vbs resume the suspended FTP service
Pauseweb. vbs pause the Web Server Service
Contweb. vbs resume the suspended WWW Service

Stop the IIS server service of the specified site
C: \ Inetpub \ admins cripts> stopsrv. vbs-A w3svc/2
Start the IIS server service of the specified site
C: \ Inetpub \ admins cripts> startsrv. vbs-A w3svc/2

Stop the Web Server Service of the specified site
C: \ Inetpub \ admins cripts> startweb. vbs-A w3svc/2
Start the Web Server Service of the specified site
C: \ Inetpub \ admins cripts> stopweb. vbs-A 2
Same as above
Stopftp. vbs stop FTP Server Service
Startftp. vbs start the FTP Server Service
Tracking Script Execution
C: \ Inetpub \ admins cripts> synciwam. vbs-H
Usage: CS cript synciwam. vbs [-v |-H]
-V verbose: trace execution of the s execution
-H help: print this message

Example:

Rem create virtual directory
Cscript scripts \ adsutil. vbs // nologo // T: 300 create w3svc/1/root/% 1 "iiswebvirtualdir"

Rem sets virtual directory attributes
Rem creates an in-process application (there is no difference between inproc and outproc in. net, but the old script can still be used)
Cscript scripts \ adsutil. vbs // nologo // T: 60 appcreateinproc w3svc/1/root/% 1
Rem sets the root directory of the application
Cscript scripts \ adsutil. vbs // nologo // T: 60 set w3svc/1/root/% 1/approot/lm/w3svc/1/root/% 1

Rem sets the display name of the application
Cscript scripts \ adsutil. vbs // nologo // T: 60 set w3svc/1/root/% 1/appfriendlyname % 1

Application Isolation level (not set in. Net)
Cscript scripts \ adsutil. vbs // nologo // T: 60 set w3svc/1/root/% 1/appisolated % 2

Rem sets the virtual directory path
Cscript scripts \ adsutil. vbs // nologo // T: 60 set w3svc/1/root/% 1/PATH % 2

Rem sets the execution permission for the virtual directory. 513 is a script-only method.
Cscript scripts \ adsutil. vbs // nologo // T: 60 set w3svc/1/root/% 1/accessflags 513

Rem sets the authflags value. 5 indicates that anonymous access is allowed and Windows authentication is integrated.
Cscript scripts \ adsutil. vbs // nologo // T: 60 set w3svc/1/root/% 1/authflags 5

REM sets the dirbrowseflags value. dirbrowseflags is a switch parameter that controls directory browsing. It is complicated. Just fill in the parameter.
cscript scripts \ adsutil. vbs // nologo // T: 60 set w3svc/1/root/% 1/dirbrowseflags 1073741886
REM settings default document
cscript scripts \ adsutil. vbs // nologo // T: 60 set w3svc/1/root/% 1/defaultdoc "default. aspx "
REM sets directory permissions (readable, unwritable, browsed script resources, and unreadable Directories)
cscript scripts \ chaccess. vbs // nologo // T: 60-A w3svc/1/root/% 1 + read-write + script-browse

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.