Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

list pc with xp1 installed 1

Status
Not open for further replies.

edwinhunt

MIS
Jun 24, 2004
38
US
hi all,

i'm just wondering if there is a way to list all the pcs in my network that has windows xp with sp1 installed or pcs with sp2 installed. right now i have computers that are mix with some with sp1 and some with sp2. i'm just wondering if there is a way to find out which one is which without going around to each one. is there a dos command line that i can use? my network is all Microsoft.

thanks,
edwin
 
C:\Windows\system32>ver /?
Displays the Windows version.

VER

C:\Windows\system32>ver

Microsoft Windows [Version 6.0.

C:\Windows\system32>


That is a Vista version, you can play with it, in case it is of any use.
 
Or...do a vbscript with the following:

Code:
On Error Resume Next

Const wbemFlagReturnImmediately = &h10
Const wbemFlagForwardOnly = &h20

arrComputers = Array("computer1", "computer2")
For Each strComputer In arrComputers

   Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
   Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_OperatingSystem", "WQL", _
                                          wbemFlagReturnImmediately + wbemFlagForwardOnly)

   For Each objItem In colItems
      WScript.Echo strComputer & " Is on ServicePack: " & objItem.ServicePackMajorVersion
Next
Next

Change the computer name to an array of comma separated computer names as seen in the script. Should work for you.

Run it from the command line after copying the code into a file called sp.vbs:


Code:
cscript /nologo sp.vbs

Nologo just doesn't display the annoying "Microsoft (R) Windows Script Host Version 5.6"

Output will look like:
computer1 Is on ServicePack: 2
computer2 Is on ServicePack: 4
...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top