Retrieving OS version with a script

Posted on 2011-04-25
Last Modified: 2012-05-11
I have computer names listed line by line in a text file (Ftext1).
I need a script that reads  the name of the computer from each line of the text file (Ftext1)retrieve the OS version in the network, then dumps the results to another text file(Ftext2) that it creates dynamically with computer name and OS version side by side .
If  the computer name read from Ftext1 is not really Windows OS, it can write computer name and "Unknown" word side by side in Ftext2.

Any script or any free tool that can do that?

Question by:jskfan
    LVL 31

    Assisted Solution

    You have a couple of choices.

    You can either

    open the text file, loop through it, connect to each machine, query the machine for OS type, write the os type to your new file, close the connection, and go to the next record until end


    connect to AD, open the text file, loop through it, query AD for the OS type, write the OS type to your new file, go to the next record until end, close the connection to AD

    The second choice would be lower bandwidth overall by far.  You can do that in several different languages, but probably easiest in either VBScript or PowerShell.

    What have you done so far?


    Author Comment

    I have not done anything so far.
    it is a long list of computer names, and some of them may be not windows OS and some of them maybe just appliances and some maybe are nor not in the network.
    so doing this task manually will take forever, this is why I need a script or kind of a discovery tool. I know about Angry IP scanner tool but I am not sure of it can retrieve the OS version.
    LVL 31

    Accepted Solution

    Any IP scanner software and the first type of script I mentioned will have the downside to non-response of the machine is off network.  The second script type doesn't care of the machine is present when the script is run, only if it is in AD or not.  When I asked what you had done thus far, I meant in terms of writing your script.


    Author Comment

    I don't have a script , I need one.

    the only script that I can think of is yhe command:

    Systeminfo /s computername /u username /p password

    username needs to be local admin( maybe in the remote computer)
    but this is command is very verbose.

    I am sure there free tools out there that can do better job.
    LVL 51

    Assisted Solution

    by:Bill Prew
    Take a look at this free tool, gives you what you want and a lot more, and can export to a flat file.


    Author Closing Comment


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
    Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
    Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
    Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

    761 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

    11 Experts available now in Live!

    Get 1:1 Help Now