option explicit dim AppsInPool, objAppPool, index, IISObj, IISPath, Version, pos Dim Versions(), objAppPools function FindASPXScriptMapVersion(ScriptMaps) Dim pos, ScriptMap for pos = lbound(ScriptMaps) to UBOund(ScriptMaps) ScriptMap = lcase(ScriptMaps(POS)) if (left(ScriptMap, 5) = ".aspx") then FindASPXScriptMapVersion = mid(ScriptMap, 42) FindASPXScriptMapVersion = left(FindASPXScriptMapVersion, _ instr(FindASPXScriptMapVersion, "\")-1) exit function end if next FindASPXScriptMapVersion = "" end function function AddVersion(Version, Path) dim Found, pos Found = false for pos = lbound(Versions) to UBound(Versions)-1 if (Versions(pos) = Version) then Found = true end if next if (Found = false) then redim preserve Versions(ubound(Versions)+1) Versions(ubound(Versions)-1)= Version end if end function Set objAppPools = GetObject("IIS://localhost/W3SVC/AppPools") for each objAppPool in objAppPools Redim Versions(0) Set objAppPool = GetObject("IIS://localhost/W3SVC/AppPools/" & objAppPool.Name ) WScript.echo objAppPool.Name AppsInPool= objAppPool.EnumAppsInPool() if (ubound(AppsInPool) = -1) then WScript.echo vbtab & "No applications using this pool!" else for index = lbound(AppsInPool) to UBound(AppsInPool) IISPath = AppsInPool(index) IISPath = "IIS://localhost/" & mid(IISPath,5, len(IISPath)-5) set IISObj = GetObject(IISPath) Version = FindASPXScriptMapVersion(IISObj.ScriptMaps) call AddVersion(Version, mid(IISPath,5, len(IISPath)-5)) next if (ubound(Versions)> 1) then WScript.Echo vbcrlf & vbtab & _ "Warning multiple version of the .NET framework detected!" & vbcrlf for pos = lbound(Versions) to ubound(Versions)-1 WScript.echo vbtab & "Found references to " & Versions(pos) next WScript.echo "" for index = lbound(AppsInPool) to UBound(AppsInPool) IISPath = AppsInPool(index) IISPath = "IIS://localhost/" & mid(IISPath,5, len(IISPath)-5) set IISObj = GetObject(IISPath) Version = FindASPXScriptMapVersion(IISObj.ScriptMaps) WScript.echo vbtab & mid(IISPath,5, len(IISPath)-5) & _ space(70 - len(IISpath)) & " - " & Version next else for pos = lbound(Versions) to ubound(Versions)-1 WScript.echo vbtab & "Found references to " & Versions(pos) next end if end if WScript.echo "" next