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