Using the Adsutil.vbs Administration Script (IIS 6.0)
Adsutil.vbs is an IIS administration utility that uses Microsoft Visual Basic Scripting Edition (VBScript) with Active Directory Service Interfaces (ADSI) to manipulate the IIS configuration. This script should be run using CScript, which is installed with Windows Script Host.
You must be a member of the Administrators group on the local computer to run scripts and executables. As a security best practice, log on to your computer using an account that is not in the Administrators group, and then use the runas command to run your script or executable as an administrator. From the command prompt, type runas /profile /user:mymachine\administrator cmd to open a command window with administrator rights and then type cscript.exeScriptName (include the script's full path and any parameters).
Cscript.exe adsutil.vbs COMMAND <path> [<param>...]
Cscript.exe adsutil.vbs COMMAND [<path> [<parameters>...]]
Display chosen parameter.
SET Path Value
Assign a new value.
ENUM Path "/P"
Enumerate all parameters for the path. /P Enumerate the paths only (no data).
Enumerate all parameters. /P Enumerate the paths only (no data).
Delete the path or parameter.
CREATE Path [KeyType]
Create the path and assign it the KeyType.
Create an in process application.
Create an out-of-process application.
Delete the application (if present).
Unload an out-of-process application.
Get status of the application.
Find the paths where a parameter is set.
Start the Web site.
Stop the Web site.
Pause the Web site.
Unpause the Web site.
Print all available commands.
<Path> is the path of the node for which you are setting the property, combined with the name of the property that you are setting. For example, if you want to set the ServerComment for Web server number 1, the command would be as follows:
adsutil SET w3svc/1/ServerComment "Web Server Number 1"
The next time IIS Manager is opened, it will reflect the name of the Web server as "Web Server Number 1."
The switch "-s:server name" can be used after any command to execute the command on a remote computer. (See first example below.)
Cscript.exe adsutil.vbs GET W3SVC/1/ServerBindings -s:remotecomputer1
Cscript.exe adsutil.vbs SET W3SVC/1/ServerBindings ":81:"
Cscript.exe adsutil.vbs CREATE W3SVC/1/Root/MyVdir "IIsWebVirtualDir"
Cscript.exe adsutil.vbs START_SERVER W3SVC/1
Cscript.exe adsutil.vbs ENUM /P W3SVC