Programmatic Administration Examples

The samples presented here demonstrate how you can create scripts that use the ADSI interfaces provided by IIS to administer the IIS installation.

Scripting languages, such as Microsoft® Visual Basic® Scripting Edition (VBScript) and JScript®, can be used to automate time-consuming administrative tasks. This section provides some simple example scripts designed to run on your local machine, written in VBScript and JScript, and executed by the Windows Script Host (WSH). The samples provided here illustrate basic techniques for accomplishing common tasks.

The general format for invoking a WSH script is either Cscript.exe ScriptName to execute the script at the command line, or Wscript.exe ScriptName to execute the script in a window. You can also create a batch file that will execute Cscript.exe or Wscript.exe and your script. For more information about WSH, please refer to the Windows Script Host documentation.

Important   WSH must be locally installed to execute these sample scripts. In addition, most of these scripts access functionality provided by IIS, and therefore require that IIS and WSH be installed locally.