In this article, I will list the WQL queries for creating SCCM device collections for Windows Server. The WQL query can be used to group the Windows Server versions, including 2025, 2022, 2019, and 2016.
Windows servers can be managed using Configuration Manager current branch. The only prerequisite is that the SCCM client must be installed on Windows Server before you can begin managing it. Please refer to the following guide to learn about different methods for how to install SCCM client on Windows Server 2022.
You must use a supported version of Windows Server for installing SCCM roles. Starting with version 2403, Configuration Manager upgrades will be blocked on hierarchies running the Windows Server 2012/2012 R2 operating system.
Windows Server comes in two flavors: GUI and Core. Out of the two, the Server Core option is a minimal installation option and has a smaller disk footprint. You can still install the SCCM client on the Windows Server core OS, but with some restrictions. Please refer to the following guide to learn how to install SCCM client on Windows Server Core.
Find Windows Server OS Version and Build Number Details
On any Windows Server, you can find the version and build number details by running the systeminfo command. Once you find the build number of Windows Server, you can use that to create the device collection in SCCM.
Login to Windows Server and launch the command prompt. Type systeminfo and press enter. From the systeminfo output, look for OS Version. For example, in the below screenshot, it’s a Windows Server 2016 and the OS version is 10.0.14393.
Running the systeminfo command on Windows Server 2019 reports the OS version as 10.0.17763.
Now that you know how to find the OS version and build number details of Windows Server 2016, let’s proceed to create SCCM device collections for Windows Server.
Windows Server Versions and Build Numbers
When you create device collections for Windows Server in ConfigMgr, the WQL query uses the build number to identify the server version. Hence, you must use the correct build number in the SCCM query to create collections for Windows Server. See also Windows Server Release info.
The below table lists the Windows Server versions and build numbers. Use this information to create SCCM device collections for Windows Server.
Windows Server Version | Build Number |
---|---|
Windows Server 2025 (version 24H2) | 26100 |
Windows Server 2022 | 20348 |
Windows Server 2019 (version 1809) | 17763 |
Windows Server 2016 (version 1607) | 14393 |
Note: Windows Server is moving to the Long-Term Servicing Channel (LTSC) as our primary release channel. The Windows Server Semi-Annual Channel (SAC) was retired on August 9, 2022. There will be no future SAC releases of Windows Server.
SCCM Device Collections for Windows Server
We will now look the process of creating SCCM device collections for Windows Server. I will list the WQL query for all the latest versions of Windows Server.
Windows Server 2025
Use the below WQL query to create a device collection for Windows Server 2025.
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.Version = "10.0.26100" and SMS_G_System_OPERATING_SYSTEM.Caption = "Microsoft Windows Server 2025 Datacenter"
Windows Server 2022
Use the below WQL query to create a device collection for Windows Server 2012.
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.Version = "10.0.20348" and SMS_G_System_OPERATING_SYSTEM.Caption = "Microsoft Windows Server 2022 Datacenter"
Windows Server 2019
Use the below WQL query to create a device collection for Windows Server 2019.
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.Version = "10.0.17763" and SMS_G_System_OPERATING_SYSTEM.Caption = "Microsoft Windows Server 2019 Datacenter"
Windows Server 2016
Use the below WQL query to create a device collection for Windows Server 2016.
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.Version = "10.0.14393" and SMS_G_System_OPERATING_SYSTEM.Caption = "Microsoft Windows Server 2016 Datacenter"
Still Need Help?
If you need further assistance on the above article or want to discuss other technical issues, check out some of these options.