det eneste jeg har der kan det.. er noget slamkode som jeg ik lige har fået rydtet op i endnu..
så det kan godt være det er lidt u-overskueligt..
computer="localhost"
webname="testsite.dk"
ArgComputers = Array("LocalHost")
ArgWebSites = webname
ArgNum = 0
for compIndex = 0 to UBound(ArgComputers)
set foundSite = findWeb(ArgComputers(compIndex), ArgWebSites)
if isObject(foundSite) then
response.write " Web Site Number = "&foundSite.Name
response.write " Web Site Description = "&foundSite.ServerComment
aBinding=foundSite.ServerBindings
if (IsArray(aBinding)) then
if aBinding(0) = "" then
binding = Null
else
binding = getBinding(aBinding(0))
end if
else
if aBinding = "" then
binding = Null
else
binding = getBinding(aBinding)
end if
end if
if (IsArray(binding)) then
response.write " Hostname = "&binding(2)
response.write " Port = "&binding(1)
response.write " IP Address = "&binding(2)
end if
else
Trace "No matching web found."
end if
next
function getBinding(bindstr)
Dim one, two, ia, ip, hn
one=Instr(bindstr,":")
two=Instr((one+1),bindstr,":")
ia=Mid(bindstr,1,(one-1))
ip=Mid(bindstr,(one+1),((two-one)-1))
hn=Mid(bindstr,(two+1))
getBinding=Array(ia,ip,hn)
end function
Function findWeb(computer, webname)
On Error Resume Next
Dim websvc, site
dim webinfo
Dim aBinding, binding
set websvc = GetObject("
IIS://"&computer&"/W3svc")
if (Err <> 0) then
exit function
end if
' First try to open the webname.
set site = websvc.GetObject("IIsWebServer", webname)
if (Err = 0) and (not isNull(site)) then
if (site.class = "IIsWebServer") then
' Here we found a site that is a web server.
set findWeb = site
exit function
end if
end if
err.clear
for each site in websvc
if site.class = "IIsWebServer" then
'
' First, check to see if the ServerComment
' matches
'
If site.ServerComment = webname Then
set findWeb = site
exit function
End If
aBinding=site.ServerBindings
if (IsArray(aBinding)) then
if aBinding(0) = "" then
binding = Null
else
binding = getBinding(aBinding(0))
end if
else
if aBinding = "" then
binding = Null
else
binding = getBinding(aBinding)
end if
end if
if IsArray(binding) then
if (binding(2) = webname) or (binding(0) = webname) then
set findWeb = site
exit function
End If
end if
end if
next
end function
set sjov= findweb(computer,webname)
response.write site %>