Quantcast
Viewing all articles
Browse latest Browse all 700

Query to list all Windows XP machines that do not have SP3

How can I create a query to list all Windows XP machines that do not have SP3?  I found this VBscript on a webpage, but can I use WMI filters when making a query and then ultimately a Collection to install Windows XP SP3 to all machines that do not already have it installed?

set oSvc = GetObject("winmgmts:")
set Systems = oSvc.ExecQuery("Select * from Win32_OperatingSystem")
for each sys in Systems
    wscript.echo "ServicePack number: " & sys.ServicePackMajorVersion
next

I tried to use System Resource.Operating System Name and "%Workstation 5.1%".
I tried to use Operating System.Caption and "Microsoft Windows XP Professional".
I tried to use Operating System.Version and "5.1.2600".

These obviously only gave me ALL Windows XP machines.  I was looking for something to couple with one of these to retrieve the Service Pack number for the machine.  I found in KB (http://support.microsoft.com/kb/969393/) that Up until Internet Explorer 7 the Windows XP service pack number was related to the IE version (http://social.technet.microsoft.com/Forums/en/configmgrinventory/thread/5329bea9-5d33-4f31-9182-525b82c0ba83).

6.00.2600.0000  Internet Explorer 6 (Windows XP)
6.00.2800.1106  Internet Explorer 6 Service Pack 1 (Windows XP SP1)
6.00.2900.2180  Internet Explorer 6 for Windows XP SP2
6.00.2900.5512  Internet Explorer 6 for Windows XP SP3

Of course this only helps if the machine has Internet Explorer 6.  This does not help for IE 7 or 8. 

HELP!  I am banging my head as to why "ServicePackMajorVersion" is not easily available thru SCCM under theAttribute Class of Operating System.


Viewing all articles
Browse latest Browse all 700

Trending Articles