• subscribe
July 17, 2001 12:00 AM

Using VBScript Programs to Track Your Web Sites

Windows IT Pro
InstantDoc ID #21557
Downloads
21557.zip

This month, I show you a simple VBScript program that lists the Web sites on any server to which you have access on your LAN or WAN. The script comes in two versions: listwebappsany.vbs, which Listing 1 shows, and listwebappsanytofile.vbs, which Listing 2 shows. Listwebappsany.vbs displays the number, name, and server name for each Web site on the server or on a remote server if you specify the server's name. The second script performs the same tasks but writes the results to the C:\scripts\listwebapps.txt file. The scripts use Microsoft Active Directory Service Interfaces (ADSI) to talk to the IIS metabase and extract the Web site information. Of course, to execute the scripts successfully, you must have the proper security permissions to the resources that those scripts use (e.g., metabase, file system).

These scripts are useful for discovering the Web sites on a local or remote server either interactively or by calling the script from another application. This versatility lets you inspect or gather information about Web sites on any system to which you have access. In addition, the scripts make it easy to perform the search in one step. Also, the scripts are faster than using Internet Services Manager (ISM) to explore the remote systems. Because the program is written in VBScript, you can paste portions of scripts from other files into the VBScript file to modify it to perform other tasks.

Using Listwebappsany.vbs
You can run listwebappsany.vbs without arguments to display the Web sites on your local system. To display the Web sites on another system, execute the program and specify the name of the remote system as a parameter.

For example, executing the command

ListWebAppsAny

on my notebook computer displays the results that Figure 1 shows. In Figure 1, the name of the server appears as LOCALHOST, which is the default server name and points to the current server. To execute the program on a remote server, use the command

ListWebAppsAny servername

where servername is the server on which you want to list the applications.



ARTICLE TOOLS

Comments
    There are no comments to display. Be the first one!
You must log on before posting a comment.

Are you a new visitor? Register Here