Trække information ud af IIS
Hej.Jeg sidder og roder med et vbscript, hvor jeg skal trække information ud af IIS metadatabasen. Er ret så meget nybegynder i vb btw.
Disse ting skal jeg have ud fra IIS:
Sitenavn (hostheader)
Physical location (fx. c:\Inetpub\wwwroot)
IP adresse, port
Site id (identifier)
Logfile path
Security (anonymt, ntlm?)
Frontpage server ext (yes/no)
SSL (yes/no)
Mit script ser således ud pt:
MachineName = "localhost"
IIsObjectPath = "IIS://" & MachineName & "/w3svc"
Set IIsObject = GetObject(IIsObjectPath)
for each obj in IISObject
if (Obj.Class = "IIsWebServer") then
BindingPath = IIsObjectPath & "/" & Obj.Name
Set IIsObjectIP = GetObject(BindingPath)
wScript.Echo IISObjectIP.ServerComment & " ( W3SVC" & obj.Name & " ) "
ValueList = IISObjectIP.Get("ServerBindings")
ValueString = ""
For ValueIndex = 0 To UBound(ValueList)
value = ValueList(ValueIndex)
Values = split(value, ":")
IP = values(0)
if (IP = "") then
IP = "(All Unassigned)"
end if
TCP = values(1)
if (TCP = "") then
TCP = "80"
end if
HostHeader = values(2)
if (HostHeader <> "") then
wScript.Echo " IP = " & IP & " TCP/IP Port = " & TCP & ", HostHeader = " & HostHeader
else
wScript.Echo " IP = " & IP & " TCP/IP Port = " & TCP
end if
Next
wScript.Echo "test"
set IISObjectIP = Nothing
end if
next
set IISObject = Nothing
Nogen der har nogle gode tips?