WMI Filter für Gruppenrichtlinien, richtig definiert und eingesetzt, sind wahre Helfer bei der Zielbestimmung Teil 2.
Welche Version und Produkttype hat mein aktuelles System und wer ist der Hersteller?
Get-CimInstance -Class Win32_OperatingSystem | Select Version, ProductType
(Get-CimInstance -ClassName Win32_ComputerSystem).Manufacturer
WMI Filter für Betriebssysteme
SELECT Version,ProductType FROM Win32_OperatingSystem WHERE Version LIKE “<Version>” AND ProductType = “1”
WMI Filter für Windows 10 inkl. Build Nummer
SELECT Version,BuildNumber,ProductType FROM Win32_OperatingSystem WHERE Version LIKE “<Version>” AND BuildNumber = “<Build>” AND ProductType = “1”
WMI Filter für Serversysteme
SELECT Version,ProductType FROM Win32_OperatingSystem WHERE Version LIKE “<Version>” AND ( ProductType = “2” or ProductType = “3” )
WMI Filter für Windows Server 2016 inkl. Build Nummer
SELECT Version,BuildNumber,ProductType FROM Win32_OperatingSystem WHERE Version LIKE “<Version>” AND BuildNumber = “<Build>” AND ( ProductType = “2” or ProductType = “3” )
Versionsnummer für Windows 10:
Windows 10: 10.0%
Windows 10 Version 2004: 10.0.19041
Windows 10 Version 1909: 10.0.18363
Windows 10 Version 1903: 10.0.18362
Windows 10 Version 1809: 10.0.17763
Windows 10 Version 1803: 10.0.17134
Windows 10 Version 1709: 10.0.16299
Windows 10 Version 1703: 10.0.15063
Windows 10 Version 1607: 10.0.14393
Windows 10 Version 1511: 10.0.10586
Windows 10 Version 1507: 10.0.10240
Build Nummern für Windows 10:
Windows 10 Version 2004: 19041
Windows 10 Version 1909: 18363
Windows 10 Version 1903: 18362
Windows 10 Version 1809: 17763
Windows 10 Version 1803: 17134
Windows 10 Version 1709: 16299
Windows 10 Version 1703: 15063
Windows 10 Version 1607: 14393
Windows 10 Version 1511: 10586
Windows 10 Version 1507: 10240
Versionsnummer für Windows Server 2016
Windows Server 2016: 10.0%
Windows Server 2016 Version 1809: 10.0.17763
Windows Server 2016 Version 1803: 10.0.17134
Windows Server 2016 Version 1709: 10.0.16299
Windows Server 2016 Version 1607: 10.0.14393
Versionsnummer für Windows Server 2019
Windows Server 2019: 10.0%
Windows Server 2019 Version 1809: 10.0.17763
Produkt Typ Nummern:
Client: ProductType=”1″
Server: ProductType=”3″
Domain Controller: ProductType=”2″
Beispiele für eine Abfrage:
Windows Server 2019
SELECT * FROM Win32_OperatingSystem WHERE (Version LIKE “10.0.17763%”) OR (Version LIKE “10.0.18362%”) OR (Version LIKE “10.0.18363%”) AND ProductType<>”1″
Windows Server 2019 – DC
SELECT * FROM Win32_OperatingSystem WHERE (Version LIKE “10.0.17763%”) OR (Version LIKE “10.0.18362%”) OR (Version LIKE “10.0.18363%”) AND ProductType=”2″
Windows Server 2019 – non-DC
SELECT * FROM Win32_OperatingSystem WHERE (Version LIKE “10.0.17763%”) OR (Version LIKE “10.0.18362%”) OR (Version LIKE “10.0.18363%”) AND ProductType=”3″
WMI Filter für Office Produkte
SELECT path,filename,extension,version FROM CIM_DataFile WHERE (path=’\\Program Files\\Microsoft Office\\<Folder>\\’ OR path=’\\Program Files (x86)\\Microsoft Office\\<Folder>\\’) AND filename=’winword’ AND extension=’exe’ AND version > ‘<Version>’
SELECT path,filename,extension,version FROM CIM_DataFile WHERE (path=’\\Program Files\\Microsoft Office\\Office16\\’ OR path=’\\Program Files (x86)\\Microsoft Office\\Office16\\’) AND filename=’winword’ AND extension=’exe’ AND version > ’16’
Folder Angaben
Microsoft Office 2016: Office16 / 16.0
Microsoft Office 2013: Office15 / 15.0
Microsoft Office 2010: Office14 / 14.0
Microsoft Office 2007: Office13 / 13.0
Microsoft Office 2003: Office12 / 13.0
WMI Filter für Windows und Office
https://www.der-windows-papst.de/2017/12/31/wmi-abfragen-richtig-einsetzen/