Sei sulla pagina 1di 13

Updated List of OS Version Queries for WMI Filters NoGeekLeftBehind.

com Page 1 of 13

CLOSE X
Loading Image...

NOGEEKLEFTBEHIND.COM

SEPTEMBER 10, 2013 BY TIMBARRETT

Updated List of OS Version Queries for


WMI Filters
More likely than not, if youre using Group Policy to push out
software installation or registry entries to client machines or servers
on the domain, the policy may be different depending on the OS
version or architecture.

Examples, Group Policy Objects may need to be filtered by:

Desktop / Server
Domain Controller / Non-Domain Controller
32-bit / 64-bit

If you havent used WMI filters before, they show up in Group Policy
Management at the bottom, between Group Policy Objects and Starter GPOs.

http://www.nogeekleftbehind.com/2013/09/10/updated-list-of-os-version-queries-for-... 26/01/2017
Updated List of OS Version Queries for WMI Filters NoGeekLeftBehind.com Page 2 of 13

The WMI filters use a query to scope down the application of the Group Policy
Object applicability. Heres what a typical WMI OS filter looks like:

WMI Win32_OperatingSystem ProductType Tips:

ProductType 1 = Desktop OS

http://www.nogeekleftbehind.com/2013/09/10/updated-list-of-os-version-queries-for-... 26/01/2017
Updated List of OS Version Queries for WMI Filters NoGeekLeftBehind.com Page 3 of 13

ProductType 2 = Server OS Domain Controller

ProductType 3 = Server OS Not a Domain Controller

WMI Win32_OperatingSystem Version Number Tips:

5.1 Windows XP

5.2 Windows Server 2003

5.2.3 Windows Server 2003 R2

6.0 Windows Vista & Windows Server 2008

6.1 Windows 7 & Windows Server 2008 R2

6.2 Windows 8 & Windows Server 2012

6.3 Windows 8.1 & Windows Server 2012 R2

To create your own WMI filters, here is an updated list of WMI filter queries
from Window XP Windows 8.1 and from Server 2003 to Server 2012 R2.

IMPORTANT DISCLAIMER:
Always test your Group Policies and WMI filters before deploying.

DESKTOPS

http://www.nogeekleftbehind.com/2013/09/10/updated-list-of-os-version-queries-for-... 26/01/2017
Updated List of OS Version Queries for WMI Filters NoGeekLeftBehind.com Page 4 of 13

ANY WINDOWS DESKTOP OS


Any Windows Desktop OS Version 1
select * from Win32_OperatingSystem WHERE ProductType = "1"
Any Windows Desktop OS Version 2 (better for Win7 sometimes)
select * from Win32_OperatingSystem WHERE (ProductType <> "2") AND
(ProductType <> "3")
Any Windows Desktop OS 32-bit
select * from Win32_OperatingSystem WHERE ProductType = "1" AND NOT
OSArchitecture = "64-bit"
Any Windows Desktop OS 64-bit
select * from Win32_OperatingSystem WHERE ProductType = "1" AND
OSArchitecture = "64-bit"

WINDOWS XP
Windows XP
select * from Win32_OperatingSystem WHERE (Version like "5.1%" or Version
like "5.2%") AND ProductType="1"
Windows XP 32-bit
select * from Win32_OperatingSystem WHERE (Version like "5.1%" or Version
like "5.2%") AND ProductType="1" AND NOT OSArchitecture = "64-bit"
Windows XP 64-bit
select * from Win32_OperatingSystem WHERE (Version like "5.1%" or Version
like "5.2%") AND ProductType="1" AND OSArchitecture = "64-bit"

WINDOWS VISTA
Windows Vista
select * from Win32_OperatingSystem WHERE Version like "6.0%" AND
ProductType="1"

http://www.nogeekleftbehind.com/2013/09/10/updated-list-of-os-version-queries-for-... 26/01/2017
Updated List of OS Version Queries for WMI Filters NoGeekLeftBehind.com Page 5 of 13

Windows Vista 32-bit


select * from Win32_OperatingSystem WHERE Version like "6.0%" AND
ProductType="1" AND NOT OSArchitecture = "64-bit"
Windows Vista 64-bit
select * from Win32_OperatingSystem WHERE Version like "6.0%" AND
ProductType="1" AND OSArchitecture = "64-bit"

WINDOWS 7
Windows 7
select * from Win32_OperatingSystem WHERE Version like "6.1%" AND
ProductType="1"
Windows 7 32-bit
select * from Win32_OperatingSystem WHERE Version like "6.1%" AND
ProductType="1" AND NOT OSArchitecture = "64-bit"
Windows 7 64-bit
select * from Win32_OperatingSystem WHERE Version like "6.1%" AND
ProductType="1" AND OSArchitecture = "64-bit"

WINDOWS 8
Windows 8
select * from Win32_OperatingSystem WHERE Version like "6.2%" AND
ProductType="1"
Windows 8 32-bit
select * from Win32_OperatingSystem WHERE Version like "6.2%" AND
ProductType="1" AND NOT OSArchitecture = "64-bit"
Windows 8 64-bit
select * from Win32_OperatingSystem WHERE Version like "6.2%" AND
ProductType="1" AND OSArchitecture = "64-bit"

http://www.nogeekleftbehind.com/2013/09/10/updated-list-of-os-version-queries-for-... 26/01/2017
Updated List of OS Version Queries for WMI Filters NoGeekLeftBehind.com Page 6 of 13

WINDOWS 8.1
Windows 8.1
select * from Win32_OperatingSystem WHERE Version like "6.3%" AND
ProductType="1"
Windows 8.1 32-bit
select * from Win32_OperatingSystem WHERE Version like "6.3%" AND
ProductType="1" AND NOT OSArchitecture = "64-bit"
Windows 8.1 64-bit
select * from Win32_OperatingSystem WHERE Version like "6.3%" AND
ProductType="1" AND OSArchitecture = "64-bit"

SERVERS

ANY WINDOWS SERVER OS


Any Windows Server OS
select * from Win32_OperatingSystem where (ProductType = "2") OR
(ProductType = "3")
Any Windows Server OS 32-bit
select * from Win32_OperatingSystem where (ProductType = "2") OR
(ProductType = "3") AND NOT OSArchitecture = "64-bit"
Any Windows Server OS 64-bit
select * from Win32_OperatingSystem where (ProductType = "2") OR
(ProductType = "3") AND OSArchitecture = "64-bit"
Any Windows Server Domain Controller
select * from Win32_OperatingSystem where (ProductType = "2")
Any Windows Server Domain Controller 32-bit
select * from Win32_OperatingSystem where (ProductType = "2") AND NOT
OSArchitecture = "64-bit"

http://www.nogeekleftbehind.com/2013/09/10/updated-list-of-os-version-queries-for-... 26/01/2017
Updated List of OS Version Queries for WMI Filters NoGeekLeftBehind.com Page 7 of 13

Any Windows Server Domain Controller 64-bit


select * from Win32_OperatingSystem where (ProductType = "2") AND
OSArchitecture = "64-bit"
Any Windows Server Non-Domain Controller
select * from Win32_OperatingSystem where (ProductType = "3")
Any Windows Server Non- Domain Controller 32-bit
select * from Win32_OperatingSystem where (ProductType = "3") AND NOT
OSArchitecture = "64-bit"
Any Windows Server Non-Domain Controller 64-bit
select * from Win32_OperatingSystem where (ProductType = "3") AND
OSArchitecture = "64-bit"

WINDOWS SERVER 2003


Windows Server 2003 DC
select * from Win32_OperatingSystem WHERE Version like "5.2%" AND
ProductType="2"
Windows Server 2003 non-DC
select * from Win32_OperatingSystem WHERE Version like "5.2%" AND
ProductType="3"
Windows Server 2003 32-bit DC
select * from Win32_OperatingSystem WHERE Version like "5.2%" AND
ProductType="2" AND NOT OSArchitecture = "64-bit"
Windows Server 2003 32-bit non-DC
select * from Win32_OperatingSystem WHERE Version like "5.2%" AND
ProductType="3" AND NOT OSArchitecture = "64-bit"
Windows Server 2003 64-bit DC
select * from Win32_OperatingSystem WHERE Version like "5.2%" AND
ProductType="2" AND OSArchitecture = "64-bit"
Windows Server 2003 64-bit non-DC
select * from Win32_OperatingSystem WHERE Version like "5.2%" AND
ProductType="3" AND OSArchitecture = "64-bit"

http://www.nogeekleftbehind.com/2013/09/10/updated-list-of-os-version-queries-for-... 26/01/2017
Updated List of OS Version Queries for WMI Filters NoGeekLeftBehind.com Page 8 of 13

WINDOWS SERVER 2003 R2


Windows Server 2003 R2 DC
select * from Win32_OperatingSystem WHERE Version like "5.2.3%" AND
ProductType="2"
Windows Server 2003 R2 non-DC
select * from Win32_OperatingSystem WHERE Version like "5.2.3%" AND
ProductType="3"
Windows Server 2003 R2 32-bit DC
select * from Win32_OperatingSystem WHERE Version like "5.2.3%" AND
ProductType="2" AND NOT OSArchitecture = "64-bit"
Windows Server 2003 R2 32-bit non-DC
select * from Win32_OperatingSystem WHERE Version like "5.2.3%" AND
ProductType="3" AND NOT OSArchitecture = "64-bit"
Windows Server 2003 R2 64-bit DC
select * from Win32_OperatingSystem WHERE Version like "5.2.3%" AND
ProductType="2" AND OSArchitecture = "64-bit"
Windows Server 2003 R2 64-bit non-DC
select * from Win32_OperatingSystem WHERE Version like "5.2.3%" AND
ProductType="3" AND OSArchitecture = "64-bit"

WINDOWS SERVER 2008


Windows Server 2008 DC
select * from Win32_OperatingSystem WHERE Version like "6.0%" AND
ProductType="2"
Windows Server 2008 non-DC
select * from Win32_OperatingSystem WHERE Version like "6.0%" AND
ProductType="3"
Windows Server 2008 32-bit DC
select * from Win32_OperatingSystem WHERE Version like "6.0%" AND
ProductType="2" AND NOT OSArchitecture = "64-bit"

http://www.nogeekleftbehind.com/2013/09/10/updated-list-of-os-version-queries-for-... 26/01/2017
Updated List of OS Version Queries for WMI Filters NoGeekLeftBehind.com Page 9 of 13

Windows Server 2008 32-bit non-DC


select * from Win32_OperatingSystem WHERE Version like "6.0%" AND
ProductType="3" AND NOT OSArchitecture = "64-bit"
Windows Server 2008 64-bit DC
select * from Win32_OperatingSystem WHERE Version like "6.0%" AND
ProductType="2" AND OSArchitecture = "64-bit"
Windows Server 2008 64-bit non-DC
select * from Win32_OperatingSystem WHERE Version like "6.0%" AND
ProductType="3" AND OSArchitecture = "64-bit"

WINDOWS SERVER 2008 R2


Windows Server 2008 R2 64-bit DC
select * from Win32_OperatingSystem WHERE Version like "6.1%" AND
ProductType="2"
Windows Server 2008 R2 64-bit non-DC
select * from Win32_OperatingSystem WHERE Version like "6.1%" AND
ProductType="3"

WINDOWS SERVER 2012


Windows Server 2012 64-bit DC
select * from Win32_OperatingSystem WHERE Version like "6.2%" AND
ProductType="2"
Windows Server 2012 64-bit non-DC
select * from Win32_OperatingSystem WHERE Version like "6.2%" AND
ProductType="3"

WINDOWS SERVER 2012 R2

http://www.nogeekleftbehind.com/2013/09/10/updated-list-of-os-version-queries-for-... 26/01/2017
Updated List of OS Version Queries for WMI Filters NoGeekLeftBehind.com Page 10 of 13

Windows Server 2012 R2 64-bit DC


select * from Win32_OperatingSystem WHERE Version like "6.3%" AND
ProductType="2"
Windows Server 2012 R2 64-bit non-DC
select * from Win32_OperatingSystem WHERE Version like "6.3%" AND
ProductType="3"

Rating: 9.8/10 (69 votes cast)

GROUP POLICY, SERVER 2012 R2, WINDOWS 8.1

Comments (26)
Sort by: Date Rating Last Activity

Jordan 174 weeks ago 0

Is there anyway to use a WMI filter to check for a 64bit install of Office? (2007, 2010 and
2013)

We have an Outlook plugin that needs to be pushed out with GPO, it come sin 32 and 64 bit
flavours. Thus I need a Policy to push the 64bit plugin to the 64bit Outlook installs.

Is this even possible? I have come across a few options like:


select * from Win32_Service where Name ="ose64"
But that does not seem to detect a 64bit office install.

Thanks in advance!

Reply 3 replies active 58 weeks ago

persys 158 weeks ago 0

Thanks for the info. Just a note: according to microsoft documentation the OSArchitecture
value is not supported and does not exist in XP. The queries above would be invalid...

Reply

Kyle 140 weeks ago 0

The OSArchitecture attribute is NOT AVAILABLE with Server 2003 and XP.

OSArchitecture
Data type: string
Access type: Read-only
Architecture of the operating system, as opposed to the processor. This property can be

http://www.nogeekleftbehind.com/2013/09/10/updated-list-of-os-version-queries-for-... 26/01/2017
Updated List of OS Version Queries for WMI Filters NoGeekLeftBehind.com Page 11 of 13

localized.
Example: 32-bit
****************************************************************************
Windows Server 2003 and Windows XP: This property is not available.
****************************************************************************
http://msdn.microsoft.com/en-us/library/aa394239(...

Reply

Anonymous 116 weeks ago 0

The OsArchitecture property is not an available for Windows Server 2003, so those examples
won't work.

Reply

altmrn 116 weeks ago 0

Hello, is there a way to use WMI filter to check for differents versions of the same OS? I would
like to put different GPO settings based on if the version is Standard, Enterprise, Datacenter,
etc.

Reply

Dan 111 weeks ago 0

Thanks, very useful!

Reply

Dean O'Neill 108 weeks ago 0

Damn!!! This is great info. Thanks so much.

Reply

Torsten Egeler 0p 104 weeks ago +1

Testing GWO with PowerShell. I have found this link:


https://soykablog.wordpress.com/2013/04/22/test-g...

gwmi -Query SELECT ProductType, CSName FROM Win32_OperatingSystem WHERE


(ProductType = 1) AND Not CSName = CB002021) -Computername PC01,PC02

Reply

Torsten Egeler 0p 103 weeks ago +1

0 (0x0)Standalone workstation
1 (0x1)Member workstation
2 (0x2)Standalone server
3 (0x3)Member server
4 (0x4)Backup Domain Controller
5 (0x5)Primary Domain Controller

select * from Win32_ComputerSystem where DomainRole=0

http://www.nogeekleftbehind.com/2013/09/10/updated-list-of-os-version-queries-for-... 26/01/2017
Updated List of OS Version Queries for WMI Filters NoGeekLeftBehind.com Page 12 of 13

Reply

Fred 75 weeks ago +13

I'd like to see information on Windows 10 please. Thanks in advance.

Reply 3 replies active 46 weeks ago

Mario 74 weeks ago 0

Great post, thank you for this useful information

Reply

Jeffrey 64 weeks ago 0

For Windows 10, just change the 6.x to 10.x (they made a huge jump).

i.e.

select * from Win32_OperatingSystem WHERE Version like "10.%" AND ProductType="1"

Reply

Daniel 58 weeks ago 0

Here is what I use for Windows 10.


select Version,ProductType from Win32_OperatingSystem where (Version="10.0.10240" or
Version="10.0.10586") and ProductType=1
You can use wildcards if you want, but I find them to slow down queries.
select * from Win32_OperatingSystem where Version like "10.0%" and ProductType=1

Reply

Mayank 47 weeks ago 0

Using WMI Filters to apply Group Policy to a target operating system not working..

Reply

angelcruzpr 0p 46 weeks ago +1

This info is a LIFE SAVER! Thanks a million for the endless hours saved searching for these. :-)

Reply

dognose 46 weeks ago 0

Hey,

your XP Queries are not going to Work. OSArchitecture is unknown and cannot be processed.

to find x86 XP Systems, use a WMI-Query with 2 conditions:

select * from Win32_OperatingSystem WHERE (Version like "5.1%" or Version like "5.2%")
AND ProductType="1"

http://www.nogeekleftbehind.com/2013/09/10/updated-list-of-os-version-queries-for-... 26/01/2017
Updated List of OS Version Queries for WMI Filters NoGeekLeftBehind.com Page 13 of 13

SELECT AddressWidth FROM Win32_Processor WHERE AddressWidth ='32'.

Reply

Gustavo 44 weeks ago 0

I'd like to see information on filter for lockscreen. Windows 7 and Windows 10 exclusion
groups no execute lockscreen.

Reply

Jonnyphenomenon 42 weeks ago 0

windows 10 is the same as the windows 8 options, only change the Version to 10 instead of
6.3

windows 10
select * from Win32_OperatingSystem where Version like "10.%"
windows 10 32bit
select * from Win32_OperatingSystem WHERE Version like "10.%" AND ProductType="1"
AND NOT OSArchitecture = "64-bit"
windows 10 64bit
select * from Win32_OperatingSystem WHERE Version like "10.%" AND ProductType="1"
AND OSArchitecture = "64-bit"

Reply

MikhailCompo 0p 30 weeks ago +3

@Fred and the other 13. I would have thought its obvious to work out.............

Windows 10

Windows 10
select * from Win32_OperatingSystem WHERE Version like "10.0%" AND ProductType="1"
Windows 10 32-bit
select * from Win32_OperatingSystem WHERE Version like "10.0%" AND ProductType="1"
AND NOT OSArchitecture = "64-bit"
Windows 10 64-bit
select * from Win32_OperatingSystem WHERE Version like "10.0%" AND ProductType="1"
AND OSArchitecture = "64-bit"

Reply

Post a new comment


Comment as a Guest, or login:
Subscribe to Submit Comment

http://www.nogeekleftbehind.com/2013/09/10/updated-list-of-os-version-queries-for-... 26/01/2017

Potrebbero piacerti anche