Adding Temporary Content

Applies To: Windows Server 2003, Windows Server 2003 with SP1

When you create sites, you can add temporary content files that users can replace with their own content when they are ready. An example of a temporary content file is a home page that says Coming Soon or Under Construction. Use the Adsutil.vbs command-line script to add temporary content files.

Adsutil.vbs is a flexible tool that uses the Microsoft® Visual Basic® development system, Scripting Edition (VBScript), with Microsoft® Active Directory® Service Interfaces (ADSI) to manipulate the IIS configuration. Note that Adsutil.vbs is not a Microsoft-supported product. The documentation for, and the format of, Adsutil.vbs can change at any time. For more information about Adsutil.vbs, including syntax and parameters, see Using the Adsutil.vbs Administration Script.

You must use the CScript.exe command-line tool, which is installed with Windows Script Host, to run Adsutil.vbs. You can set CScript.exe as the default run-time program by typing CScript //h:cscript //nologo //s at the command prompt.The optional //nologo parameter disables the display of the CScript copyright banner. Alternatively, you can type Cscript.exe at the beginning of the Adsutil.vbs script. For more information about using Adsutil.vbs, including commands and parameters, see Using the Adsutil.vbs Administration Script.

Listing 9.4 uses Adsutil.vbs to add a file named temp.htm to the list of default documents. Although you do not have to use the name temp.htm, do not name the file default.htm because default.htm would take precedence if the user added only index.htm as the home page. The sample script adds the temp.htm file as the last file on the Documents tab in the Web site properties so that temp.htm can never override a users home page, even if the user never deletes temp.htm. You must type the complete Adsutil.vbs script on one line.

Listing 9.4   Sample Script for Setting Up Temporary Files

Adsutil.vbs set w3svc/defaultdoc "default.htm,default.html,default.asp,default.aspx,index.htm,index.html,index.
asp,index.aspx,temp.htm"

After you add a temporary file, use the copy command to copy the file to the users directory. For example, to copy temp.htm to the users directory, at the command prompt, type copy temp.htm C:\web\username\domain\temp.htm.

Adding Temporary Content Remotely

You can run any of the Adsutil.vbs commands remotely. To add temporary content to a remote computer, add **-s:**Server to the end of the command, where Server is the name of the target server.