What is adsutil.vbs? It is a command-line-based IIS management script that is located in the%systemdrive%\inetpub\adminscripts directory, 95,426 bytes, from the Windows 2003 IIS service. Such a large script will know that the function must be very powerful, and it is true. I feel like it's a command line. Internet Information Services Manager (in fact, Windows 2000 is managed with more than 20 VBS under%SYSTEMDRIVE%\INETPUB\ADMINSCRIPTS). And by 2003, there is only one adsutil.vbs left, enough to show how powerful its function is.
Mention adsutil.vbs have to mention Metabase.bin, this file is the most important configuration file for IIS, all IIS settings will eventually be stored in this file, IIS Manager and Adsutil.vbs is through the file read configuration information to display to the user. Its storage structure is very much like the registry, is a tree-type storage structure. IIS Manager and Adsutil.vbs access Metabase.bin through a ADsPath path that starts with iis:\\, where LocalHost represents the local server, and W3SVC represents the IIS service, such as Iis:\\localhost /W3SVC/1 represents the first web site on the local server, Iis:\\localhost/w3svc/1/root/vdir represents the VDir virtual directory under the first Web site root directory.
Basic usage of Adsutil.vbs
With these predecessors, let's go back to Adsutil.vbs to see how it's used:
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://Support Command, this is the most important
Get,set,enum,delete,create,copy,appcreateinproc,appcreateoutproc,appcreatepoolproc,appdelete,appunload, AppGetStatus
Configure access permissions for the directory
C:\Inetpub\Admins cripts>chaccess.vbs-a W3svc/1/root-verbose
Usage:chaccess <--adspath|-a adspath> Control configuration Path
[--computer|-c computer1[,computer2 ...]] Specifies the machine name, and IP is also available.
Read permissions under the [+read|-read] home directory
Write permissions under the [+write|-write] home directory
The Execute permission permission under the home directory of [+s cript|-s Cript] is pure script
The Execute permission permissions under the [+execute|-execute] home directory are scripts and executable programs
Directory browsing permissions under the [+browse|-browse] home directory
[--verbose|-v] Current version
[--help|-?]
Displays the properties and status information for the 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 is displayed
Example 1:dispnode-a Iis://localhost/w3svc Displays the main properties of the current IIS
Example 2:dispnode--adspath IIS://MACHINENAME/W3SVC/1 Display status information for the current site
Look 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
Show the specified site path management tree
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> web site path name
<--COMMENT|-T SERVER comment>web Site identification
[--computer|-c computer1[,computer2 ...]]
[--port|-o Port NUM] Ports
[--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] Specifies the server name
<--website|-w website1> Specifies the virtual station Roll Call
<--virtualdir|-v name1,path1,name2,path2,... > Specify 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"
To pause the IIS service for a 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
To restore the IIS service for a 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
Usage ditto
Pauseftp.vbs Pause FTP Server service
Contftp.vbs resumes a paused FTP service
Pauseweb.vbs Pause Web Server service
Contweb.vbs resuming a paused WWW service
Stop the IIS Server service for the specified site
C:\Inetpub\Admins cripts>stopsrv.vbs-a W3SVC/2
Start the IIS Server service for the specified site
C:\Inetpub\Admins cripts>startsrv.vbs-a W3SVC/2
Stop the Web Server service for the specified site
C:\Inetpub\Admins cripts>startweb.vbs-a W3SVC/2
Start the Web Server service for the specified site
C:\Inetpub\Admins Cripts>stopweb.vbs-a 2
Usage ditto
Stopftp.vbs Stop the FTP server service
Startftp.vbs Start the FTP Server service
Tracking execution of scripts
C:\Inetpub\Admins cripts>synciwam.vbs-h
Usage:cs cript Synciwam.vbs [-v|-h]
-V verbose:trace execution of the the S Cript
-H help:print This message
Practical Examples:
REM Create a virtual directory
cscript scripts\adsutil.vbs//nologo//t:300 create w3svc/1/root/%1 "IIsWebVirtualDir"
REM set the properties of a virtual directory
REM creates an in-process application (. NET has no InProc and Outproc, but old scripts can still be used.
cscript scripts\adsutil.vbs//nologo//t:60 Appcreateinproc w3svc/1/root/%1
REM set 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 set the display name of the application
cscript scripts\adsutil.vbs//nologo//t:60 set w3svc/1/root/%1/appfriendlyname%1
The isolation level of the application (in. NET without setting)
cscript scripts\adsutil.vbs//nologo//t:60 set w3svc/1/root/%1/appisolated%2
REM set the path of the virtual directory
cscript scripts\adsutil.vbs//nologo//t:60 set W3svc/1/root/%1/path%2
REM sets the Execute permissions on the virtual directory, 513 is a pure scripting way
cscript scripts\adsutil.vbs//nologo//t:60 set w3svc/1/root/%1/accessflags 513
REM set AuthFlags value, 5 indicates allow anonymous access and integrated Windows authentication
cscript scripts\adsutil.vbs//nologo//t:60 set w3svc/1/root/%1/authflags 5
REM set the DirBrowseFlags value, DirBrowseFlags is the control of directory browsing switch parameters, more complex, just fill in the line
cscript scripts\adsutil.vbs//nologo//t:60 set W3svc/1/root/%1/dirbrowseflags 1073741886
REM Set Default Document
cscript scripts\adsutil.vbs//nologo//t:60 set W3svc/1/root/%1/defaultdoc "default.aspx"
REM Set directory permissions (readable, non-writable, browsable script resource, not viewable directory)
cscript scripts\chaccess.vbs//nologo//t:60-a w3svc/1/root/%1 +read-write
REM setting