[SOLVED] Screen search by serial number
Published: November 21, 2024 - 4:50 PM
Good morning,
in parallel with the use of the package audit-hostI propose this query which allows you to find out which computer a screen is connected to.
Via its serial number.
in parallel with the use of the package audit-hostI propose this query which allows you to find out which computer a screen is connected to.
Via its serial number.
Code: Select all
/* Remplacer le numéro de série pour trouver la machine*/
SELECT
h.computer_name,
h.last_seen_on,
h.computer_type,
had.value,
had.value->'monitors' AS monitors,
jsonb_path_query(had.value, '$.monitors[*] ? (@.serialno == "SEERIAL_HERE")') IS NOT NULL AS serial_no_found
FROM
hosts h
INNER JOIN
hostauditdata had ON h.uuid = had.host_id
WHERE
h.computer_ad_ou LIKE '%%OU_DE_RECHERCHE%%'
ORDER BY
h.computer_name ASC
LIMIT 10;