Filtrer une GPO en fonction d'un OS en utilisant les filtres WMI

Dans certains cas, il est intéressant d'appliquer des GPO uniquement à un système d'exploitation spécifique. Cela est réalisable grâce aux filtres WMI (Windows Management Instrumentation).

Quelque exemple de filtre WMI

Windows XP

SELECT * from Win32_OperatingSystem where Version like "5.1%" and ProductType="1"

Windows 7 32bit

SELECT * from Win32_OperatingSystem WHERE Version LIKE "6.1%" and ProductType="1"AND NOT OSArchitecture = “64-bit”

Windows 7 64bit

SELECT * from Win32_OperatingSystem WHERE Version LIKE "6.1%" and ProductType="1"AND OSArchitecture = “64-bit”

Windows 7 32bit et 64bit

SELECT * from Win32_OperatingSystem WHERE Version LIKE "6.1%" and ProductType="1"

Windows 8 32bit

SELECT * from Win32_OperatingSystem WHERE Version LIKE "6.2%" and ProductType="1"AND NOT OSArchitecture = “64-bit”

Windows 8 64bit

SELECT * from Win32_OperatingSystem WHERE Version LIKE "6.2%" and ProductType="1"AND OSArchitecture = “64-bit”

Windows 8 32bit et 64bit

SELECT * from Win32_OperatingSystem WHERE Version LIKE "6.2%" and ProductType="1"

Windows 8.1 32bit

SELECT * from Win32_OperatingSystem WHERE Version LIKE "6.3%" and ProductType="1" AND NOT OSArchitecture = “64-bit”

Windows 8.1 64bit

SELECT * from Win32_OperatingSystem WHERE Version LIKE "6.3%" and ProductType="1" AND OSArchitecture = “64-bit”

Windows 8.1 32bit et 64bit

SELECT * from Win32_OperatingSystem WHERE Version LIKE "6.3%" and ProductType="1"

Windows 10 32bit all builds

SELECT * from Win32_OperatingSystem WHERE Version LIKE "10%" and ProductType="1" AND NOT OSArchitecture = “64-bit”

Windows 10 64bit all builds

SELECT * from Win32_OperatingSystem WHERE Version LIKE "10%" and ProductType="1" AND OSArchitecture = “64-bit”

Windows 10 32bit et 64bit all builds

SELECT * from Win32_OperatingSystem WHERE Version LIKE "10%" and ProductType="1"

Pour filtrer sur tous les OS serveur

SELECT * from Win32_OperatingSystem where ProductType="3"

Pour filtrer sur les contrôleurs de domaine AD

SELECT * from Win32_OperatingSystem where ProductType="2"

Création d'un filtre WMI

1) Se connecter sur votre controleur de domaine Active Directory

2) Ouvrir Gestion des stratégies de groupe
Panneau de configuration\Tous les Panneaux de configuration\Outils d’administration

3) Clique droit sur Filtres WMI - Nouveau...

4) Indiquer un nom pour votre filtre et une description - Cliquer sur Ajouter

5) Indiquer la requête souhaitée puis cliquer sur OK

6) Vous pouvez ajouter une seconde requête si vous le souhaitez. Cliquer ensuite sur Enregistrer

7) Spécifier sur votre GPO le filtre WMI à appliquer

Laisser un commentaire

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *