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

Posted on 2007-10-12
Last Modified: 2008-01-09

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

Question by:bsharath
    LVL 1

    Expert Comment

    I'm not sure I unserstand the problem.
    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:
        ' returns "Microsoft-IIS/4.0" for IIS 4.0 + ASP 2.0

    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
    LVL 26

    Accepted Solution

    :: ================
    :: ================
    :: * 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.
    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
    ECHO "Computers.txt" file does not exist or file is empty!
    :: *** SCRIPT END ***

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Join & Write a Comment

    Suggested Solutions

    Recently I have been answering a lot of questions like this in IT forums that I frequent. The question posed is usually something along the lines of "We have software X installed and need to uninstall it for reason Y" or some other variant of the sa…
    Windows Script Host (WSH) has been part of Windows since Windows NT4. Windows Script Host provides architecture for building dynamic scripts that consist of a core object model, scripting hosts, and scripting engines. The key components of Window…
    The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
    The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now