How to create a collection for just Laptops | Desktops | Servers etc.
You can either find the information either in the WMI or SQL. Usually the only difference between the two class names are the prefix. “SMS_” for WMI and “v_” for SQL.
First we look up all the devices from discovery. Discovery views starts with “v_R_”. So our view name is “v_R_System”. Information about the Configuration Manager Schema mapping can be found here: https://msdn.microsoft.com/en-us/library/cc146702.aspx
Now we look up the Inventory data from the System Enclosure class
The same information can be found in WMI by querying Win32_SystemEnclosure to find the type we are on:
In SQL we can now join the two tables to find all devices with inventory data and select the ResouceID, medical Name and ChassisTypes data.
The query in Configuration Manager would then look something like this:
Code for easy copy|paste:
inner join SMS_G_System_SYSTEM_ENCLOSURE
on SMS_G_System_SYSTEM_ENCLOSURE.ResourceID = SMS_R_System.ResourceId
where SMS_G_System_SYSTEM_ENCLOSURE.ChassisTypes in ( “8”, “9”, “10”, “14” )