Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 363
  • 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
Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

 
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

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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