Hi,
I am trying to build a script that will loop through all of the Virtual
Directories on a given server and print the "Connect As" property. Not all
Virtual Directories have this property, but anything that has "A share
located on another computer" and a UNC path will have this property available.
I can't seem to find out how to retreive the Windows Account used in the
"Connect As" property for a given Virtual Directory in IIS. I have found how
to find all the Virtual Directories (code is below).
Can anyone advise me on how to get the domain account that is being used in
the "Connect As" property?
SCRIPT TO LOOK VIRTUAL DIRECTORIES ON LOCAL IIS SERVER:
Dim IISObj, strQuery, Item
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer &
"\root\MicrosoftIISv2")
Set colItems = objWMIService.ExecQuery( _
"SELECT * FROM IIsWebVirtualDirSetting",,48)
For Each objItem in colItems
Wscript.Echo "Name: " & objItem.Name
Next