Page 1 of 1

[SOLVED] Display Windows 11 build number

Published: June 19, 2025 - 5:04 PM
by ddcorazon
Hello everyone,

I would like an SQL query that displays the versions of Windows 11 that do not have a certain build, for example.

To simply display the PCs running Windows 24H2, I do this:

Code: Select all

SELECT
    computer_name,
    computer_fqdn,
    os_name,
    os_version,
    waptwua_status->>'enabled' AS waptwua_enabled
FROM
    hosts
WHERE
    os_name LIKE 'Windows 11 Pro'
    AND os_version LIKE '10.0.26100'
    AND waptwua_status->>'enabled' = 'true';

However, if I want to display, for example, a specific version, let's say those who are on build 26100.4349, by doing os_version LIKE '10.0.26100.4349' for example, the result is empty.

Does anyone have another method?

Thank you everyone, and have a good afternoon

Augustin

Re: Displaying Windows 11 build number

Published: June 19, 2025 - 5:57 PM
by blemoigne
Good morning,
Here is a solution:

Code: Select all

SELECT
    computer_name,
    computer_fqdn,
    os_name,
    host_info->>'windows_version_full' as windows_version_full,
    waptwua_status->>'enabled' AS waptwua_enabled
FROM
    hosts
WHERE
    os_name LIKE 'Windows 11 Pro'
    AND host_info->>'windows_version_full' like '10.0.22631%%'
    AND waptwua_status->>'enabled' = 'true'
Have a good rest of the day
Bertrand

Re: Displaying Windows 11 build number

Published: June 19, 2025 - 11:04 PM
by ddcorazon
Great,
thanks Bertrand. I'd forgotten that host_info returns a JSON object, and I was looking directly for the full_version in the table structure.
Have a good evening,

Augustin.