Count Configuration Manager client versions in your environment
SQL query for the Configuration Manager database that counts how many computers run each client version.
LanguageSQL
What it does to the systemReads only. It changes nothing.
After a site update, clients upgrade over days or weeks. This query shows how far the client upgrade has come.
The result shows one row per client version with the number of computers. The newest version is at the top.
SQL
-- 1 = count only computers with a client. 0 = also count discovered computers with no client.
DECLARE @ClientsOnly BIT = 1;
SELECT
ISNULL(rs.Client_Version0, 'No client') AS ClientVersion,
COUNT(*) AS Computers
FROM v_R_System rs
WHERE ISNULL(rs.Obsolete0, 0) = 0
AND (@ClientsOnly = 0 OR rs.Client0 = 1)
GROUP BY rs.Client_Version0
ORDER BY rs.Client_Version0 DESC;
How to use it
- Open SQL Server Management Studio and connect to the site database.
- Paste the query into a new query window.
- Run the query.
- Set
@ClientsOnlyto 0 to also count computers that have no client. - Compare the top version with the client version of your site.
Good to know
- The query skips obsolete records.
- The version comes from client discovery data, not from hardware inventory.
client version
client upgrade
v_R_System
Client_Version0
More SCCM SQL queries
Check BitLocker protection status for each computer
Find computers that have not rebooted in 14 days
Find computers with low free space on the C: drive
Find computers with no hardware inventory in 30 days
Find duplicate computer names and duplicate serial numbers
List all computers with a named application installed