WMI Filtering para OS

Las directivas de grupo se pueden necesitar filtrar por

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


Los WMI Filter es una query aplicable a las GPO. Estos son los filtros VMI típicos para detectar el S.O


WMI Win32_OperatingSystem ProductType

  • ProductType 1 = Desktop OS
  • ProductType 2 = Server OS – Domain Controller
  • ProductType 3 = Server OS – Not a Domain Controller

WMI Win32_OperatingSystem “Version Number”

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

10.0*- Windows 10 &  Windows Server 2016 Tech Preview

Clientes

Client OS Server OS Version Build
Windows 98 4.1 (1998)
Windows 98 Second Edition 4.1 (2222)
Windows Me 4.90 (3000)
Windows 2000 Professional 5.0 (2195)
Windows XP SP3 5.1. (2600)
Windows XP Professional x64 5.2 (3790)
Windows Vista Windows Server 2008 6.0 (6000)
Windows 7 Windows Server 2008 R2 6.1 (7601)
Windows 8 Windows Server 2012 6.2 (9200)
Windows 8.1 Windows Server 2012 R2 6.3 (9200)
Windows 8.1, Update1 Windows Server 2012 R2 6.3 (9600)
Windows 10 10.0 (10240)

(10586)

Cualquier (any) WINDOWS DESKTOP Queries

  • 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  (32 & 64 bits)
    select * from Win32_OperatingSystem WHERE Version like “6.0%” AND ProductType=”1″
  • 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  (32 & 64 bits)
    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 
    (32 & 64 bits)
    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”

WINDOWS 8.1

  • Windows 8.1  (32 & 64 bits)
    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”

WINDOWS 10

  • Windows 10
    select * from Win32_OperatingSystem WHERE Version like “10.%” AND ProductType=”1″
  • Windows 10 – 32-bit
    select * from Win32_OperatingSystem WHERE Version like “10.%” AND ProductType=”1″ AND NOT OSArchitecture = “64-bit
  • Windows 10 – 64-bit
    select * from Win32_OperatingSystem WHERE Version like “10.%” AND ProductType=”1″ AND OSArchitecture = “64-Bit”

SERVIDORES

ANY WINDOWS SERVER OS

  • Any Windows Server OS (32 & 64 bits)
    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”
  • 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  (32 & 64 bits)
    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”

WINDOWS SERVER 2003 R2

  • Windows Server 2003 R2 – DC  (32 & 64 bits)
    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  (32 & 64 bits)
    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”
  • 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

  • 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″

WINDOWS SERVER 2016

  • Windows Server 2012 R2 – 64-bit – DC
    select * from Win32_OperatingSystem WHERE Version like “10.%” AND ProductType=”2″
  • Windows Server 2012 R2 – 64-bit – non-DC
    select * from Win32_OperatingSystem WHERE Version like “10.%” AND ProductType=”3″

Be the first to comment

Leave a Reply