GPO WMI Filter for Non-Activated Windows and Office

M.G 0 Reputation points
2025-03-14T06:32:48.4466667+00:00

What is the correct WMI filter to use in a Group Policy Object (GPO) for targeting non-activated versions of Windows and Office in a domain environment?

Windows for business | Windows Server | User experience | Other
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Chen Tran 1,645 Reputation points Independent Advisor
    2025-08-11T09:05:45.3866667+00:00

    Hello,

    Thank you for posting question on Microsoft Windows Forum.

    Based on your query for the correct WMI filter to use in a Group Policy Object (GPO) for targeting non-activated versions of Windows and Office in a domain environment. Well! There is not a single, perfectly reliable WMI filter to target both non-activated Windows and Office simultaneously because a machine can have multiple licensing entries. However, you can try to create the following one to check for either condition.

    • SELECT * FROM SoftwareLicensingProduct WHERE (Name LIKE 'Windows%' AND LicenseStatus <> 1) OR (Name LIKE 'Office%' AND LicenseStatus <> 1)
    • This query checks the SoftwareLicensingProduct WMI class, which holds licensing information for major Microsoft products.
      • SELECT * FROM SoftwareLicensingProduct: This specifies that we are querying the product licensing information on the computer.
      • WHERE (Name LIKE 'Windows%' AND LicenseStatus <> 1): This is the first condition.
        • Name LIKE 'Windows%': It looks for any product whose name begins with "Windows". This covers various versions like Windows 10 Pro, Windows 11 Enterprise, etc.
        • LicenseStatus <> 1: It checks the license status. A status of 1 means the product is fully licensed and activated. Any other value (0, 2, 3, or 4,) indicates a non-activated state, such as a grace period, notification mode, or unlicensed.
      • OR: This operator links the two conditions. The GPO will apply if the first condition (for Windows) is true OR if the second condition (for Office) is true.
      • (Name LIKE 'Office%' AND LicenseStatus <> 1): This is the second condition, which works identically to the first but targets products whose names begin with "Office". This covers versions like Office 2016, Office 2019, Microsoft 365 Apps, etc.

    Some Key Consideration:

    • Activation info may vary by version and installation method.
    • These filters rely on having the appropriate WMI providers installed. If SoftwareLicensingProduct is not available, the query will fail.
    • Please note: Test the filter thoroughly and carefully in a testing environment before deploying.

    Hope the above information is helpful!

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.