query windows client and version for collection

matteu31 467 Reputation points
2021-02-01T17:46:34.407+00:00

Hello,

I would like to know if there is a better query to filter on computer/server OS version to dynamically build collection.

my sample for w10 2004:

  select * 
from SMS_R_System inner join SMS_G_System_OPERATING_SYSTEM on SMS_G_System_OPERATING_SYSTEM.ResourceID = SMS_R_System.ResourceId inner join SMS_G_System_SYSTEM on SMS_G_System_SYSTEM.ResourceID = SMS_R_System.ResourceId where SMS_G_System_OPERATING_SYSTEM.BuildNumber = "19041" and SMS_G_System_SYSTEM.SystemRole = "Workstation"

my sample for server 2019:

select *    
from SMS_R_System inner join SMS_G_System_OPERATING_SYSTEM on SMS_G_System_OPERATING_SYSTEM.ResourceID = SMS_R_System.ResourceId inner join SMS_G_System_SYSTEM on SMS_G_System_SYSTEM.ResourceID = SMS_R_System.ResourceId where SMS_G_System_OPERATING_SYSTEM.BuildNumber = "17763" and SMS_G_System_SYSTEM.SystemRole = "Server"

Thank you for your answer.

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
12,852 questions
0 comments No comments
{count} votes

6 answers

Sort by: Most helpful
  1. matteu31 467 Reputation points
    2021-02-09T14:00:45.817+00:00

    Thank you for your answer.

    IsVirtualMachine seems to have false positive on my environment lab.
    I have only 1 host with vmware virtual machine and I can see some report true on "isvirtualmachine" and some report "false". I don't understand why....

    65715-2021-02-09-15h00-24.png

    I suppose I can use this to find if it's VM or not with good filter (vmware / hyper-v / ...)

    65865-2021-02-09-15h01-26.png

    0 comments No comments