WQL Query

Here is a list of WQL queries to assist with common tasks

select SMS_R_System.Name,

SMS_R_System.Client,

SMS_R_System.OperatingSystemNameandVersion,

SMS_R_System.Build

from SMS_R_System where SMS_R_System.Build like “17763.%”

or SMS_R_System.OperatingSystemNameandVersion like “%server%”

 

Change the Build version (“17763.%”) value to get details about other version.

 

select

SMS_R_System.Name,

SMS_R_System.Client,

SMS_R_System.OperatingSystemNameandVersion

from SMS_R_System

where SMS_R_System.OperatingSystemNameandVersion like “%Workstation 10.0%”

Here is sample query to collect data for Window 20H2, 

 

select SMS_R_System.Name,

SMS_R_System.Client,

SMS_R_System.OperatingSystemNameandVersion,

SMS_R_System.Build

from SMS_R_System where SMS_R_System.Build like “10.0.19042.%”

or SMS_R_System.OperatingSystemNameandVersion like “%Workstation%”

 

 

Change built version  “10.0.19042.%” to get details about other windows 10  version. 

 

Follow the below link to get Windows 10 Built Version Details.

https://docs.microsoft.com/en-us/windows/release-health/release-information

 

 

 

select Name,

SMSAssignedSites,

OperatingSystemNameandVersion,

ResourceDomainORWorkgroup,

NetbiosName,

ClientType

from sms_r_system

select Name,

SMSAssignedSites,

OperatingSystemNameandVersion,

ResourceDomainORWorkgroup,

LastLogonUserDomain,

NetbiosName

from sms_r_system

where Client = 0 or Client is null

select Name,

SMSAssignedSites,

OperatingSystemNameandVersion,

ResourceDomainORWorkgroup,

NetbiosName,

ClientType

rom sms_r_system

where Client = 1

select

SMS_R_System.Name,

SMS_R_System.Client,

SMS_R_System.OperatingSystemNameandVersion

from SMS_R_System

where SMS_R_System.OperatingSystemNameandVersion like “%server%”

select distinct sys.Name,

sys.OperatingSystemNameandVersion,

sys.ResourceDomainORWorkgroup,

sys.LastLogonUserName

from SMS_G_System_SoftwareProduct as prod

inner join SMS_R_System as sys on sys.ResourceId = prod.ResourceID

where prod.ProductName like “%Google Chrome%” and prod.ProductVersion like “%91.0%”

 

Note:- Change the Software name and version if you are looking for some specific software or version.