script to inventory OS on machines

With XP end of life approaching soon I'm in need of a way to find out what machine has XP and what machine does not do I can reinstall or replace the  OS.   I only need the OS type and machine name.  I tried:

Set /p var= enter the computer file:

wmic /node:%var% os get CSName, Version, Caption> "C:\list.csv

but I'm getting RPC errors.  Is there a better way?
WellingtonISAsked:
Who is Participating?
 
WellingtonISConnect With a Mentor Author Commented:
0
 
Lee W, MVPTechnology and Business Process AdvisorCommented:
You could put spiceworks on to inventory the entire network or Query AD for a list of OSs on the workstations.
0
 
WellingtonISAuthor Commented:
No spiceworks too busy but thanks for that suggestion.
0
 
WellingtonISAuthor Commented:
Trying Powershell

Get-ADComputer "OU=General_use_PC,OU=PCS,OU=Wel_Computers,OU=Wellington,OU=Acute Facilities,DC=Corp,DC=UHSINC,DC=Biz -Filter {OperatingSystem -NotLike "*server*"} -Property * | Format-Table Name,OperatingSystem,OperatingSystemServicePack -Wrap -Auto

Now working either...
0
 
WellingtonISAuthor Commented:
Found this and it did the trick
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.