Click to See Complete Forum and Search --> : Enumerate IIS Properties


Exxon_Beta
October 12th, 2005, 01:18 PM
Hi, I'm trying to enumerate the Local Path for every web site I have configured on my 8 web servers. I have looked and looked all over and can't find the Local Path property. here's what I have so far:

-----------------------------------------------------
Dim objW3SVC, objSITE, strServer, TarterUNC
Dim objFSO, objLog

strServer = "LOCALHOST"
TarterUNC = "IIS://" & strServer & "\W3SVC"

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objW3SVC = GetObject(TarterUNC)

For Each objSITE In objW3SVC

If objSITE.CLASS = "IIsWebServer" Then
WScript.Echo objSITE.Name
WScript.Echo objSITE.ServerComment
WScript.Echo objSITE.ServerState
WScript.Echo objSITE.DefaultDoc
WScript.Echo objSITE.?????????????
WScript.Echo ""
End If

Next

-----------------------------------------------------------------------

How do I get the Local Path to the web site, such as c:\inetpub\wwwroot

Any help would be greatly appreciated. Thanks.

PeejAvery
October 12th, 2005, 01:42 PM
PHP can do that or do you have a set language in mind?

<?php echo $_SERVER['DOCUMENT_ROOT']; ?>

boumerlin
October 14th, 2005, 06:42 PM
Or in ASP:


<%
dim path
path = Request.ServerVariables("Path_Translated")
%>



<table border="1">
<tr><b>
<td>Variable Name</td>
<td>Value</td>
</b></tr>

<%
For Each Key in Request.ServerVariables
Response.Write "<tr><td>" & key & "</td><td>"

if Request.ServerVariables(key) = "" then
Response.Write "&nbsp;"
else
Response.Write Request.ServerVariables(key)
end if

Response.Write "</td></tr>"
Next
%>

</table>