Understanding SMS Database Classes

When you build an SMS query, you specify the attribute or attributes within an object type, which is also a Windows Management Instrumentation (WMI) class, that the query uses to search the SMS site database. Any database objects that match one or more specified attributes are returned by the query. An object type is a class containing a set of attributes that represent an SMS database object, such as a client, a user, a user group, a package, or an advertisement. The set of attributes for an object type describe the object. Related attributes are grouped together into attribute classes. SMS object types are WMI classes, and SMS attributes are WMI properties. For a list of the SMS object types, see the "SMS Object Types" section later in this chapter.

For more information about SMS object classes, attributes, and properties, see the Microsoft Systems Management Server 2003 Software Development Kit.

The SMS SDK is an excellent source for information about the SMS database and its object classes and attributes. To download the SMS SDK, see the MSDN Web site at https://msdn.microsoft.com.

Another way to understand the SMS classes is to browse the underlying WMI classes, as described in Appendix B, "Windows Management Instrumentation."

Most of the queries that you create are based on the discovery class SMS_R_System and on the set of inventory classes that begin with SMS_G_System. The SMS_R_System class contains discovery data for all discovered SMS system resources, such as clients, printers, routers, users, and user groups. This class includes properties (attributes) such as IPAddress, OperatingSystemNameandVersion, and Name (system name). The set of SMS_G_System classes contain inventory data for the same SMS resources, such as the SMS_G_System_LOGICAL_DISK attribute class. This class contains information about a client's logical disk drive, such as Availability, Name, FileSystem, and FreeSpace. The ResourceID property links the SMS_R_System class and the SMS_G_System classes.

If you configure hardware inventory on your SMS site, the Hardware Inventory Client Agent gathers information about the hardware on each client. If you configure software inventory, the Software Inventory Client Agent collects information about specific file types and collects the files you specify. SMS passes this information through the client access point (CAP) or management point to the site server and incorporates hardware and software information into the SMS site database. When the data is available, you can use a query to obtain data from the SMS site database about clients that meet certain criteria; for example, all clients that have less than 256 MB of RAM installed.

Viewing attribute data

One of the best ways to write useful queries is to first view the attribute data directly in the SMS site database. This helps you to confirm that the data you require is available and to identify the classes, instances, and attributes to which you must refer in a query to retrieve that data. Appendix B, "Windows Management Instrumentation," provides useful information about tools, such as CIM Studio, that you can use to view the WMI classes.

You can also use Resource Explorer to determine which attributes you need and what the data type of the value should be. For many queries, your object type is System Resource, and if hardware inventory was run on your site, you can use Resource Explorer to narrow your search.

To use Resource Explorer

  1. In the SMS Administrator console, navigate to Collections.

  2. Locate a client that matches the type of computer that you want to query.

  3. Right-click the client, point to All Tasks, and then click Start Resource Explorer.

  4. In the Resource Explorer tree, expand the Hardware folder.

    The displayed folders represent each attribute class in the System Resource object type. For example, in the Hardware folder, the Logical Disk folder represents the SMS_G_System_LOGICAL_DISK class. Click a folder and view the column names across the top of the details pane. These represent the attributes of that attribute class. For example, in the Logical Disk folder, the File System column represents the FileSystem attribute. The values displayed in the details pane are in the correct data type.

For More Information

Did you find this information useful? Please send your suggestions and comments about the documentation to smsdocs@microsoft.com.