I've setup a GPO to install an application (WU Client) and I only want it installed on the Windows XP workstations without SP1 or SP2. Here are the variations, in order that I tested.
SELECT * from Win32OperatingSystem WHERE BuildNumber=2600 and ServicePackMajorVersion=0
Followed by
SELECT * from Win32OperatingSystem WHERE BuildNumber=2600 and ServicePackMajorVersion<0
then by
SELECT * from Win32OperatingSystem WHERE BuildNumber=2600 and ServicePackMajorVersion="0"
then
SELECT * from Win32OperatingSystem WHERE BuildNumber=2600 and ServicePackMajorVersion IS NULL
by
SELECT * from Win32OperatingSystem WHERE Caption=Microsoft Windows XP Professional and ServicePackMajorVersion=0 (plus the variants above)
I also tried adding a second query instead of stringing two in the same one. I also used tried quotes, but logically, I shouldn't need them based on the example filters in the GPM console.
SELECT * from Win32OperatingSystem WHERE BuildNumber=2600
SELECT * from Win32OperatingSystem WHERE ServicePackMajorVersion=0
Still new to scripting with wmi. Thanks!
Our community of experts have been thoroughly vetted for their expertise and industry experience.