The Query Builder automatically creates the
relational joins between different attribute classes. You can view these
joins by looking at the WQL statement directly or by viewing the Joins tab on the Query Statement Properties dialog
box. ResourceID is the attribute generally used for joins. You may
occasionally find that MachineID and ItemKey in one attribute class map
to ResourceID in another attribute class. You can also use
relationships, operations, and joins to query discovery and inventory
data, as discussed in the following sections.
Querying Discovery Data
You can use the following classes to query discovery data:
System Resource—
Use the System Resource class for system properties such as System
Container Name, System OU Name, AD Site Name, ConfigMgr Client Version,
System IP Address, System Name, and more. If you are building queries
manually, join classes in WQL using the ResourceID property of the
SMS_R_System class. For example, for a simple WQL query to include the
Active Directory site named TestLab, enter the following query:
Select * from SMS_R_System where SMS_R_System.ADSiteName = "TestLab"
User Resource— This class is used for user properties, such as User OU Name, User Group Name, and User Name.
User Group Resource—
The User Group Resource class is used for AD user group properties,
such as User Group Name, Unique User Group Name, and Domain.
The
most important piece of information to remember about discovery data is
that most of it is available to you even before the computer system has
a ConfigMgr client installed. As an example, you will be able to query
for systems in an Active Directory site even if you have not installed
clients. This is an important step when deploying ConfigMgr to a new
environment. Use this data to enable discovery methods, and build
queries and reports to obtain a better idea of the locations of your
enterprise systems—prior to installing clients.
Querying Inventory Data
All hardware and
software inventory will appear through the System Resource object type.
If you extend SMS_Def.mof , the hardware inventory classes and attributes will also appear in the System Resource object type. The SMS Advanced Client State class is
inventoried using WMI during a hardware inventory cycle. Several
favorite inventory classes appear in Table 1, along with a brief description.
Table 1. Popular Hardware and Software Inventory Classes
Name | Description |
---|
Add/Remove Programs | Contains
hardware inventory information based on information found in Add or
Remove Programs (a.k.a. Programs and Features in Windows Vista). If you
have x64 systems, you may also need to include Add/Remove Programs (64). |
Computer System | Contains
information based on the Win32_ComputerSystem WMI class, which includes
time zone information, computer manufacturer and model, and more. |
Disk Drives | Contains
information based on the Win32_DiskDrive WMI class, which includes hard
drive manufacturer information, the number of partitions, the size of
the drive, and more. Disk Partitions is also a popular class. |
Last Software Scan | Contains
the last software inventory scan date, which can be helpful when
troubleshooting systems. It also provides a better perspective of the
“freshness” of your data. |
Network Adapter Configuration | Contains static IP configuration information. |
Operating System | Based
on the Win32_OperatingSystem WMI class. This class contains Windows and
system directory information, operating system version and service
pack, as well as virtual and physical memory information. |
PC BIOS | Contains BIOS version, release date, and manufacturer information. |
Services | Based on Win32_Service WMI class. Contains all Windows service information such as current status, executable path, and more. |
Shares | Lists the shares configured on the operating system. |
Software Files | Query this class by .exe filename. Based on Software Inventory. |
Software Products | Query this class based on information in the .exe file header information. Based on Software Inventory. |
USB Device | Displays information for USB devices attached to the system. |
Virtual Machine and Virtual Machine Details | Contains information for a virtual machine’s host operating system and computer name. |
Workstation Status | Contains
the last hardware inventory scan date, which can be helpful when
troubleshooting systems. It also provides a better perspective of the
“freshness” of your data. |
If
any of the inventory attributes do not appear in your environment, you
may need to review the classes and attributes you have configured to
inventory using SMS_Def.mof.
If you find this information is missing for a specific system, you need
to verify that system is healthy, because you need a healthy ConfigMgr
client to send its inventory to the ConfigMgr site. If you do not see
any inventory for any system, you may need to confirm that
hardware/software inventory is configured for your site.