IIS 5 & IIS 6
Configuration & Scripting
Enumerate IIS6.0 virtual directories using WMI in VBScript
Last post Jun 15, 2007 03:14 AM by Zhao Ji Ma - MSFT
Jun 11, 2007 12:04 PM|dishahinduja|LINK
I am trying to enumerate IIS Virtual directories using WMI in VBScript using the following function:
strComputer = "."
Set objWMIService = GetObject _
& strComputer & "\root\microsoftiisv2")
Set colItems = objWMIService.ExecQuery("Select * from IIsWebVirtualDir")
For Each objItem in colItems
If LCase(objItem.Name) = "w3svc/1/root/cfxtemp" then
ChartFXVirtualDir = "True"
ChartFXVirtualDir = "False"
I am testing to make sure a particular virtual directory exists by enumerating all virtual directories.
It works fine on most Windows 2003 SP1 machines. But on certain systems, it only enumerates the root directory and doesnt list any virtual directories under the root. Can anybody think of a possible reason? (I am sure it is not permissions)
Jun 11, 2007 03:49 PMemail@example.com|LINK
Might look at:
Jun 13, 2007 04:15 AM|Zhao Ji Ma - MSFT|LINK
Is it permission issue? Please check if there is differece in DCOM launch and activation permissions for a user or group in your Windows Server 2003 SP1 servers.
The following link is for remote accessing, but I think you can still use it for reference. Hope it helps.
Jun 15, 2007 03:14 AM|Zhao Ji Ma - MSFT|LINK
It is able to enumerate virtual directories by searching “metabase.xml” for “IIsWebVirtualDir” too. Hope it helps!