Create WMI Filters for the GPO
Hello All,
Hope this post finds you in good health and spirit. To ensure that any GPO associated with a group may only be deployed to devices running the relevant version of Windows, create and add WMI filters to the GPO using the Group Policy Management MMC snap-in. Although you can create a separate membership group for each GPO, you must then manage the memberships of the various groups.
Instead, use a single membership group and allow WMI filters guarantee that the relevant GPO is applied to each device automatically. Administrative credentials To execute these processes, you must be a member of the Domain Administrators group or have been assigned GPO modification authority. Create the WMI filter first, and then configure it to check for a certain version (or versions) of the Windows operating system.
To create a WMI filter that queries for a specified version of Windows
- Open the Group Policy Management console.
- In the navigation pane, expand Forest: YourForestName, expand Domains, expand YourDomainName, and then select WMI Filters.
- Select Action, and then select New.
- In the Name text box, type the name of the WMI filter. Be sure to use a name that clearly indicates the purpose of the filter. Check to see if your organization has a naming convention.
- In the Description text box, type a description for the WMI filter. For example, if the filter excludes domain controllers, you might consider stating that in the description.
- Select Add.
- Leave the Namespace value set to root\CIMv2.
- In the Query text box, type:
SELECT * FROM Win32_OperatingSystem WHERE Caption = "Microsoft Windows 8.1 Enterprise"
For devices running at least Windows Vista and Windows Server 2008, this query will return true. Use “6.2%” to limit your search to Windows 8 and Windows Server 2012. Use “10.%” for Windows 11, Windows 10, and Windows Server 2016. To indicate several versions, use or, as seen in the following:
... where Version like "6.1%" or Version like "6.2%"