[RESOLVED] Windows 10 - Windows 11 compatible machines per AD domain

Share your tips or issues concerning the WAPT Console or WAPT Agent here
Forum Rules
Community Forum Rules
* English support on www.reddit.com/r/wapt
* French community support is available on this forum
* Please prefix the topic title with [RESOLVED] if it is resolved.
* Please do not edit a topic that is tagged [RESOLVED]. Open a new topic referencing the old one.
* Specify the installed WAPT version, full version, and build number (2.2.1.11957 / 2.2.2.12337 / etc.) as well as the Enterprise/Discovery edition.
* Versions 1.8.2 and earlier are no longer supported. The only questions accepted regarding version 1.8.2 are related to upgrading to a supported version (2.1, 2.2, etc.).
* Specify the server OS (Linux/Windows) and version (Debian Buster/Bullseye - CentOS 7 - Windows Server 2012/2016/2019).
* Specify the OS of the administration/package creation machine and the machine with the problematic agent, if applicable (Windows 7/10/11/Debian 11/etc.).
* Avoid asking multiple questions when opening a topic, otherwise it may be ignored. If there are multiple topics, open separate topics, preferably one after the other and not all at the same time (i.e., do not spam the forum).
* Include code snippets, screenshots, and other images directly in the post. Links to Pastebin, Bitly, and other third-party sites will be systematically removed.
* As with any community forum, support is provided voluntarily by members. If you require commercial support, you can contact Tranquil IT's sales department at 02.40.97.57.55
Catherine
Messages: 65
Registration: March 26, 2026 - 4:16 PM

September 17, 2026 - 09:25

Hello,

I would like to create a query on the WAPT console to extract all the remaining Windows 10 PCs from my Active Directory (I have three Active Directory domains).
This is to determine how many I still need to migrate to Windows 11.

I don't know the commands to do this. 🤦‍♀️

Thank you for your help.
Have a nice day.
jarnaud
Messages: 28
Registration: May 3, 2024 - 3:37 p.m.

September 17, 2026 - 11:34

Good morning,

You can try this query which will display the number of machines per domain, still in version 10.

Code: Select all

SELECT
    COALESCE(dnsdomain, 'TOTAL') AS dnsdomain,
    COUNT(*) AS nombre_machines,
    STRING_AGG(computer_name, ', ' ORDER BY computer_name) AS machines
FROM hosts
WHERE os_name ~* '^Windows 10'
GROUP BY ROLLUP (dnsdomain)
ORDER BY
    CASE WHEN dnsdomain IS NULL THEN 1 ELSE 0 END,
    dnsdomain;

Alternatively, if you prefer a line-by-line rendering to better see the computer_names, you can try this:

Code: Select all

SELECT
    dnsdomain,
    computer_name,
    os_name
FROM (
    SELECT
        dnsdomain,
        computer_name,
        os_name,
        1 AS ordre,
        computer_name AS tri
    FROM hosts
    WHERE os_name ~* '^Windows 10'

    UNION ALL

    SELECT
        dnsdomain,
        'TOTAL ' || dnsdomain,
        COUNT(*)::text,
        2 AS ordre,
        ''
    FROM hosts
    WHERE os_name ~* '^Windows 10'
    GROUP BY dnsdomain

    UNION ALL

    SELECT
        'TOTAL',
        'TOTAL',
        COUNT(*)::text,
        3 AS ordre,
        ''
    FROM hosts
    WHERE os_name ~* '^Windows 10'
) AS resultats
ORDER BY
    dnsdomain,
    ordre,
    tri;
Yours sincerely
Catherine
Messages: 65
Registration: March 26, 2026 - 4:16 PM

September 17, 2026 - 11:45

Hello,

Correction: the second solution is correct, but it shows me all the PCs running Windows 10,
which is exactly what I asked for.
I didn't specify that in a query I asked which PCs are capable of migrating and which are not.

So, in the second formula, I would like it to only show me the PCs that are still capable of migrating.

Thank you very much for your help.
Have a nice day
jarnaud
Messages: 28
Registration: May 3, 2024 - 3:37 p.m.

September 17, 2026 - 2:17 PM

Hello,


could you share your request with me so I can try to adapt it?
I'd like to start with this and add total lines if that works for you.

Best regards
Catherine
Messages: 65
Registration: March 26, 2026 - 4:16 PM

September 17, 2026 - 2:29 PM

Here's the query to find PCs that aren't compatible with Windows 11


: `SELECT
h.uuid,
h.computer_fqdn,
ha.value_section,
ha.value_key,
ha.value
FROM
hostauditdata as ha
JOIN
hosts as h on h.uuid = ha.host_id
WHERE
ha.value_section = 'w11-requirements' AND
ha.value_key = 'result' AND
ha.value ?& '{NOT CAPABLE}'`.


So I have the PCs that are compatible with Windows 11, which I was able to migrate using the console, and the "not compatible" ones; these will be changed.


And for my part, I'd like to know how many PCs I still need to migrate from Windows 10 compatible to Windows 11 in my Active Directory.
jarnaud
Messages: 28
Registration: May 3, 2024 - 3:37 p.m.

September 18, 2026 - 08:36

Good morning,

Can you try this?

Code: Select all

SELECT
    h.dnsdomain,
    COUNT(*) AS nombre_machines,
    STRING_AGG(h.computer_name, ', ' ORDER BY h.computer_name) AS machines
FROM hosts AS h
JOIN hostauditdata AS ha
    ON h.uuid = ha.host_id
WHERE
    h.os_name ~* '^Windows 10'
    AND ha.value_section = 'w11-requirements'
    AND ha.value_key = 'result'
    AND ha.value ?& '{CAPABLE}'
GROUP BY
    h.dnsdomain
ORDER BY
    h.dnsdomain;
Or

Code: Select all

SELECT
    h.dnsdomain,
    h.computer_name,
    h.os_name
FROM hosts AS h
JOIN hostauditdata AS ha
    ON h.uuid = ha.host_id
WHERE
    h.os_name ~* '^Windows 10'
    AND ha.value_section = 'w11-requirements'
    AND ha.value_key = 'result'
    AND ha.value ?& '{CAPABLE}'
ORDER BY
    h.dnsdomain,
    h.computer_name;
Yours sincerely
Catherine
Messages: 65
Registration: March 26, 2026 - 4:16 PM

September 18, 2026 - 08:46

Hi Jarnaud,

thank you so much, 🙏🙏 it works perfectly!

I'm not very good with SQL yet, lol.

Have a great day! Thanks again. :D
Catherine
Messages: 65
Registration: March 26, 2026 - 4:16 PM

September 18, 2026 - 08:57

Quick question: is it possible
to set the DNS domain to the number of machines and then list the corresponding machines directly below?

For example, AD --A number of machines xxxx
, and below that, all the PCs that correspond to AD A,
and so on, since I have 3 ADs.
Otherwise, it's not a big deal, it works for me

Thanks again, it's great! Have a
nice day.
jarnaud
Messages: 28
Registration: May 3, 2024 - 3:37 p.m.

September 18, 2026 - 09:30

No worries, the requests can still be useful to others.

So it might be possible, but you'd have to ask someone more knowledgeable than me (probably chatgpt or others ^^)
Unfortunately, SQL works line by line.
I am not capable of giving this type of presentation.
Here's what the cat suggested, you should try it out on your end :D
My model only has one area, so I can't really guarantee the result.

Code: Select all

SELECT
    dnsdomain,
    affichage
FROM (
    SELECT
        h.dnsdomain,
        h.dnsdomain || ' - ' || COUNT(*) || ' machines' AS affichage,
        0 AS ordre,
        '' AS tri
    FROM hosts AS h
    JOIN hostauditdata AS ha
        ON h.uuid = ha.host_id
    WHERE
        h.os_name ~* '^Windows 10'
        AND ha.value_section = 'w11-requirements'
        AND ha.value_key = 'result'
        AND ha.value ?& '{CAPABLE}'
    GROUP BY h.dnsdomain

    UNION ALL

    SELECT
        h.dnsdomain,
        '    ' || h.computer_name AS affichage,
        1 AS ordre,
        h.computer_name AS tri
    FROM hosts AS h
    JOIN hostauditdata AS ha
        ON h.uuid = ha.host_id
    WHERE
        h.os_name ~* '^Windows 10'
        AND ha.value_section = 'w11-requirements'
        AND ha.value_key = 'result'
        AND ha.value ?& '{CAPABLE}'
) AS resultats
ORDER BY
    dnsdomain,
    ordre,
    tri;
Best regards
Catherine
Messages: 65
Registration: March 26, 2026 - 4:16 PM

September 18, 2026 - 09:40

Well, you see, you shouldn't underestimate yourself. :D

It works very well, it's exactly what I wanted, and I thank you very much😊😊🙏🙏

. Thank you!
Locked