Find the version of IIS installed in all machines in the file.

Hi,

Find the version of IIS installed in all machines in the file.
Any script to query with each machine and get these details.

Regards
Sharath
LVL 11
bsharathAsked:
Who is Participating?
 
Farhan KaziSystems EngineerCommented:
:: ================
:: READ THIS FIRST
:: ================
:: * To run this script you must have domain administrators rights.
:: * This script require "Computers.txt" file from where it will pick computer names.
:: * Successful run will generate "IISVersionInfo.txt"
:: * Copy and Paste following script into notepad and save it with any name having .cmd extension.
:: SCRIPT START
@ECHO OFF
SETLOCAL EnableDelayedExpansion
IF NOT EXIST Computers.txt GOTO ShowErr
FOR %%R IN (Computers.txt) DO IF %%~zR EQU 0 GOTO ShowErr
IF EXIST IISVersionInfo.txt DEL /F /Q IISVersionInfo.txt
FOR /F %%c IN ('TYPE Computers.txt') DO (
    ECHO Processing: %%c
      PING -n 1 -w 800 %%c|Find /I "TTL" >NUL
      IF NOT ERRORLEVEL 1 (
            SC \\%%c QUERY |FIND /I "IISADMIN" >NUL
            IF NOT ERRORLEVEL 1 (
                  SET Qry=WMIC /NODE:"%%c" /NAMESPACE:"\\root\MicrosoftIISv2" PATH IIsWebInfo GET MajorIIsVersionNumber, MinorIIsVersionNumber, Status /FORMAT:CSV
                  FOR /F "Skip=1 tokens=1-3 delims=," %%x IN ('!Qry! 2^>NUL ^|FIND ","') DO ECHO %%x: IIS version %%y.%%z>>IISVersionInfo.txt
            ) ELSE ( ECHO %%c: *ERROR* IIS Service Not Found.>>IISVersionInfo.txt)
      )ELSE (ECHO Unable to connect '%%c'))
GOTO EndScript
:ShowErr
ECHO "Computers.txt" file does not exist or file is empty!
:EndScript
ENDLOCAL
:: *** SCRIPT END ***
0
 
billy_sodotCommented:
I'm not sure I unserstand the problem.
Anyway:
If you are running Windows Server 2003, you are running IIS 6.0
If you are running Windows XP, you are running IIS 5.1
If you are running Windows 2000, you are running IIS 5.0
If you are running Windows NT 4.0 or Windows 9x, you can determine which version of IIS / PWS you are running by one of the following methods:
<%
    response.write(Request.ServerVariables("SERVER_SOFTWARE"))
    ' returns "Microsoft-IIS/4.0" for IIS 4.0 + ASP 2.0
%>

OR
 
Do a search for ASP.DLL on your system
right-click it and select Properties
Check the version tab:

IIS 3.0 shows 1.x
IIS 4.0 shows 2.x
IIS 5.0 shows 5.0.2195.x
IIS 5.1 shows 5.1.2600.x
IIS 6.0 shows 6.0.3790.x

(Taken from http://classicasp.aspfaq.com/general/how-do-i-determine-which-version-of-iis/asp-i-m-running.html)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.