• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 365
  • Last Modified:

Retrieving OS version with a script

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?

Thanks
0
jskfan
Asked:
jskfan
  • 3
  • 2
3 Solutions
 
Justin OwensITIL Problem ManagerCommented:
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

or

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?

DrUltima
0
 
jskfanAuthor Commented:
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.
0
 
Justin OwensITIL Problem ManagerCommented:
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.

DrUltima
0
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

 
jskfanAuthor Commented:
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.
0
 
Bill PrewCommented:
Take a look at this free tool, gives you what you want and a lot more, and can export to a flat file.

http://www.snapfiles.com/get/aremoteinfo.html

~bp
0
 
jskfanAuthor Commented:
Excellent
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.

Join & Write a Comment

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now