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.

All the different ChassisTypes numbers and what type of device that is can be found on MSDN Win32_SystemEnclosure class – https://msdn.microsoft.com/en-us/library/aa394474(v=vs.85).

The query in Configuration Manager would then look something like this:


Code for easy copy|paste:

select SMS_R_SYSTEM.ResourceID, salve SMS_R_SYSTEM.ResourceType, sovaldi SMS_R_SYSTEM.Name,

SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup,SMS_R_SYSTEM.Client

from SMS_R_System

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” )

 

Leave a Reply