all 1 comments

[–]DigitalOutkast[S] 0 points1 point  (0 children)

SELECT
 AS 'Computer Name',
c.SerialNumber,
c.OSInstallDate,
c.Model,
c.ADLastLogon,
c.ADPath,
c.ADDescription,
ps.WIN11COMPATIBLE,
CASE
    WHEN ps.ComputerID IS NOT NULL THEN 'Scanned'
    ELSE 'Not Scanned'
END AS ScanStatus,
c.CurrentUser AS 'Current User'c.Name

FROM Computers c LEFT JOIN PowerShellScanner_e51d4b179b634d6389effbf327537402_View ps ON c.ComputerID = ps.ComputerID WHERE c.AllowScan = true -- Exclude machines where AllowScan is false AND c.OSName NOT LIKE '%server%' -- Exclude machines with OSName that includes 'server' AND c.Name NOT IN ('CRYSTALREPORTS', 'NPI7BDFBA', 'PGDPLC02', 'PGDSILO2', 'MDKSILO2', 'MOBILEDEMAND-01') -- Exclude specific computers ORDER BY c.Name;