RE: Exporting Text File list of all virtual sites running in IIS

From: Yan Liu [MS] (
Date: 10/21/02

From: (Yan Liu [MS])
Date: Mon, 21 Oct 2002 08:36:58 GMT


Do you mean you want to get all the virtual directories under 'Default Web
Site'? If so, you may try:

Set objIIS = GetObject("IIS://localhost/W3SVC/1/ROOT")

For Each obj In objIIS

    WScript.Echo obj.Name & ":" & obj.KeyType


You can use FileSystemObject to create a text file so that the results will
be exported to the text file.

Also there is a useful tool to check the metabase settings for IIS, check
out the following article if you are interested:;en-us;Q232068

Yan Liu
This posting is provided "AS IS" with no warranties, and confers no rights.