The WQL syntax in those queries is valid, but the behavior depends on how the collection is limited and how Windows 11 devices are identified in Configuration Manager.
Key points to verify:
- Collection limiting and OS targeting
The queries shown return all devices whoseSMS_WindowsServicingStates.Stateis3(soon to expire) or4(expired). They are not OS-specific. For Windows 10, the collections work because they are limited to a Windows 10–only collection. For Windows 11, the same approach must be used, but with a correctly defined Windows 11–only limiting collection. For example, a query-based collection for a specific OS can be built by joiningSMS_R_Systemwith the OS inventory class and filtering on OS properties (such as SKU or version). The documentation shows how to do this for multi-session SKUs:
The same pattern should be used to define a Windows 11 devices collection (with the appropriate OS filter), and then the servicing-state collections should be limited to that collection.select SMS_R_SYSTEM.ResourceID, SMS_R_SYSTEM.ResourceType, SMS_R_SYSTEM.Name, SMS_R_SYSTEM.SMSUniqueIdentifier, SMS_R_SYSTEM.ResourceDomainORWorkgroup, SMS_R_SYSTEM.Client from SMS_R_System inner join SMS_G_System_OPERATING_SYSTEM on SMS_G_System_OPERATING_SYSTEM.ResourceId = SMS_R_System.ResourceId where SMS_G_System_OPERATING_SYSTEM.OperatingSystemSKU = 175 - Use collection limiting instead of embedding OS logic
Configuration Manager supports collection-limiting queries in Extended WQL. A query can be limited to a specific collection either by:- Setting
LimitToCollectionId(for example, when creating a query withNew-CMQuery), or - Using the console’s Limiting collection field when creating a device collection.
State = '3'orState = '4') and rely on the limiting collection to scope them to Windows 11 devices. - Setting
- Confirm the Windows 11 collection is correct
If the Windows 11 limiting collection is misconfigured (for example, incorrect OS filter, wrong SKU, or missing OS inventory), then the servicing-state collections will not show the expected Windows 11 devices even though the WQL forState = '3'orState = '4'is correct. Validate that:- The Windows 11 collection is query-based and correctly filters on Windows 11 OS properties.
- Devices appear in that Windows 11 collection as expected.
- The servicing-state collections are limited to that Windows 11 collection.
- How to implement via PowerShell (optional)
If creating or adjusting these collections via PowerShell, useAdd-CMDeviceCollectionQueryMembershipRulewith the servicing-state WQL and ensure the target collection is already limited to Windows 11 devices:
The collection "Win11 Servicing Soon" should itself be limited to the Windows 11 devices collection.$wql = "select SMS_R_System.ResourceID,SMS_R_System.ResourceType,SMS_R_System.Name,SMS_R_System.SMSUniqueIdentifier,SMS_R_System.ResourceDomainORWorkgroup,SMS_R_System.Client from SMS_R_System LEFT OUTER JOIN SMS_WindowsServicingStates ON SMS_WindowsServicingStates.Build = SMS_R_System.build01 AND SMS_WindowsServicingStates.branch = SMS_R_System.osbranch01 where SMS_WindowsServicingStates.State = '3'" Add-CMDeviceCollectionQueryMembershipRule -CollectionName "Win11 Servicing Soon" -QueryExpression $wql -RuleName "Win11 Servicing Soon"
In summary, the WQL for State = '3' and State = '4' is structurally correct; the issue is likely with how Windows 11 devices are identified and used as the limiting collection. Ensure the Windows 11 collection is correctly defined and used as the limiting collection for the servicing-state collections.
References: