Chapter 3. Looking Inside Configuration Manager

Microsoft’s System Center Configuration Manager (ConfigMgr) 2007 delivers a variety of configuration management and system support services via a flexible and distributed architecture. ConfigMgr 2007 takes advantage of standards-based network protocols and security for its internal working and interaction with client systems. Configuration Manager components store and use data about ConfigMgr infrastructure and activity, the environment, and managed site systems in the site database. Microsoft provides an extensive set of queries and reports based on this data, as well as facilities for extracting data for your own queries and reports.

This chapter examines the inner workings of Configuration Manager. It describes the design concepts and working principles of ConfigMgr 2007, along with the ways that ConfigMgr utilizes core Windows technologies, specifically Active Directory (AD) and Windows Management Instrumentation (WMI). It also discusses the various components of Configuration Manager, how they communicate with each other, and how they work together to implement ConfigMgr features. The chapter looks inside the site database, which is the heart of Configuration Manager. It shows how you can view the inner workings of ConfigMgr through its status messages and logs, as well as through other tools for viewing database and process activity. The emphasis of this chapter is on depth rather than breadth. The authors have chosen some of the most important feature sets and data structures to use as examples throughout the chapter, rather than try to provide a comprehensive exposition of all ConfigMgr functionality.

For those readers who are simply looking to get Configuration Manager up and running, some of the material in this chapter may not be essential. These readers may still find a quick review of the “Schema Extensions” section helpful for planning purposes. They may also find some of the methods used in the “Status Messages and Logs” section useful for troubleshooting purposes. The “Managing WMI” section provides some additional guidance on troubleshooting WMI issues. For those who desire a deeper understanding of what is going on behind the scenes with ConfigMgr, the material in this chapter will help you grasp the architectural principles of the product and guide you into exploring the inner workings of Configuration Manager.

Design Concepts

Microsoft designed Configuration Manager 2007 to deliver enhanced management services to a wide variety of Windows-based systems. Its predecessor, Systems Management Server (SMS), ease managing desktop and laptop computers in an enterprise network environment. (For information regarding the different versions of SMS, see Chapter 2, “Configuration Manager 2007 Overview.”) Configuration Manager builds on the core functionality of SMS and adds an enhanced feature set that includes advanced operating system (OS) deployment capabilities and asset management features as well as support for new Out of Band (OOB) Management technologies. ConfigMgr also extends management capabilities to managed computers accessible through the Internet.

In this latest release of its systems management software, Microsoft emphasizes security and compliance, scalability and operational simplicity. To help customers meet security and compliance goals, Configuration Manager 2007 implements the following features:

Patch Management— One of the most important features of ConfigMgr 2007’s SMS 2003 predecessor was its capabilities for deploying patches to Windows clients and reporting on system patch compliance status. Configuration Manager improves and extends this capability by integrating with Microsoft’s Windows Software Update Service (WSUS) and implementing Network Access Protection (NAP) to prevent noncompliant systems from joining the network. Chapter 15, “Patch Management,” discusses patch deployment and NAP.

Configuration Management— ConfigMgr’s Desired Configuration Management (DCM) allows you to ensure compliance with defined standards to prevent misconfigurations and reduce the attack surface of your systems. You will find a discussion of DCM in Chapter 16, “Desired Configuration Management.”

Active Directory Integration— Configuration Manager 2007’s integration with Active Directory provides authentication and access control. The “Active Directory Integration” section of this chapter discusses these features.

Security— Configuration Manager uses certificate-based authentication, encryption, and data integrity controls to secure communications between the site systems and clients. Configuration Manager provides a new security mode, called native mode, which is required for some but not all certificate-based functionality. Chapter 6, “Architecture Design Planning,” discusses certificates and native mode.

Microsoft has also made ConfigMgr 2007 more scalable. Some scalability enhancements include the following:

Distributed processing— SMS 2003 included the ability to distribute functional roles to other systems in the environment. ConfigMgr 2007 introduces additional roles that can be distributed, helping to balance the processing load required by any single server.

Scale out— Network Load Balancing (NLB) clusters enable scaling out certain roles.

Flexible hierarchy— ConfigMgr’s flexible hierarchy model enables deploying its services to remote locations with limited network connectivity. This includes the branch distribution point capability, new with Configuration Manager 2007.

Manageability— Configuration Manager uses Internet-standard protocols to extend management capabilities to Windows mobile devices and managed systems accessible through the Internet.

Chapter 6 includes a discussion on configuring site system roles, hierarchy design, and management of mobile devices and Internet clients.

Configuration Manager’s capabilities can help simplify your operations in the following areas:

Planning— Inventory and discovery data provide a central information store you can use in intelligently planning your operations. The “Inside the ConfigMgr Database” section of this chapter introduces the database and some of its potential uses.

Deployment— Features for capturing, managing, and distributing system images and migrating user state information make it easier to provision new systems and upgrade existing ones. Chapter 19, “Operating System Deployment,” presents ConfigMgr’s Operating System Deployment (OSD) capabilities.

Enhancing— Configuration Manager provides capabilities to easily deploy and maintain software applications on large numbers of client systems. Chapter 14, “Distributing Packages,” discusses ConfigMgr software distribution in detail.

Life cycle management— ConfigMgr 2007’s improved Asset Intelligence capabilities help you track and manage hardware and software assets throughout their life cycle. Chapter 18, “Reporting,” discusses the use of Asset Intelligence.

To implement these capabilities, Configuration Manager leverages key elements of the Windows platform. The two most important Windows components are AD and WMI. The next sections look in depth at how ConfigMgr uses these technologies.

Active Directory Integration

Active Directory is the central information store that Windows Server uses to maintain entity and relationship data for a wide variety of objects in a networked environment. AD provides a set of core services, including authentication, authorization, and directory services. Configuration Manager requires an Active Directory environment and takes advantage of AD to support many of its features. For more information about Active Directory in Windows Server 2003 and Windows Server 2008, see the following references:

http://www.microsoft.com/windowsserver2003/technologies/directory/activedirectory/default.mspx for information regarding Windows Server 2003 and Active Directory

http://www.microsoft.com/windowsserver2008/en/us/active-directory.aspx for details on Active Directory in Windows Server 2008

In an Active Directory environment, all processes run in the security context of a user or a security context supplied by the operating system. System accounts are special accounts included on each Windows system used to run processes in a context supplied by the operating system. Prior to AD, the only built-in system account context was the Local System account. The Windows NT Local System account provided unlimited access to system resources, but you could not use it for network requests.

Using Active Directory, each system has a computer account that you can add to user groups and grant access to resources anywhere on the network. Windows Server 2003 and later operating systems add two other built-in accounts with limited access:

• The Local Service account has essentially the same rights on the local system as a nonprivileged user and no access to the network.

• The Network Service account has rights and network access similar to a nonprivileged user account.

ConfigMgr 2007 makes extensive use of system and computer accounts to run processes. Using system accounts greatly simplifies administration, eliminating the need to create and manage the large number of service accounts required with early versions of SMS.

In addition to authentication and access control services, Configuration Manager 2007 can use AD to publish information about its sites and services, making ConfigMgr easily accessible to Active Directory clients. To take advantage of this capability, you must extend the AD schema to create classes of objects specific to Configuration Manager. Although extending the schema is not required for ConfigMgr to work, it is required for certain Configuration Manager features. Extending the schema also greatly simplifies ConfigMgr deployment and operations. The “Schema Extensions” section of this chapter discusses extending the AD schema, and the “Benefits of Extending Active Directory” section covers the feature dependencies and administrative advantages provided by the schema extensions.

Configuration Manager can also take advantage of Active Directory in the following ways:

• Discovering information about your environment, including the existence of potential client systems. Chapter 12, “Client Management,” discusses the discovery process.

• Assigning and installing clients through group policy, also described in Chapter 12. In addition, you can use group policy to configure basic services used by ConfigMgr.

• Using certificates and certificate settings deployed through AD to enhance its own security, as discussed in Chapter 6.

Schema Extensions

All objects in Active Directory are instances of classes defined in the AD schema. The schema provides definitions for common objects such as users, computers, and printers. Each object class has a set of attributes that describes members of the class. As an example, an object of the computer class has a name, operating system, and so forth. Additional information about the AD schema is available at http://msdn.microsoft.com/en-us/library/ms675085(VS.85).aspx.

The schema is extensible, allowing administrators and applications to define new object classes and modify existing classes. Using the schema extensions provided with Configuration Manager eases administering your ConfigMgr environment. The ConfigMgr schema extensions are relatively low risk and involve only a specific set of classes not likely to cause conflicts. Extending the schema is a recommended best practice for Configuration Manager because it allows you to avoid additional configuration tasks and implement stronger security. Nevertheless, you will want to test any schema modifications before applying them to your production environment.

Tools for Extending the Schema

You can extend the schema in either of two ways:

• Running the ExtADSch.exe utility from the ConfigMgr installation media

• Using the LDIFDE (Lightweight Data Interchange Format Data Exchange) utility to import the ConfigMgr_ad_schema.ldf LDIF file

If you are extending the schema on a Windows 2000 domain controller, you must use the LDIF file.

Using ExtADSch

Using ExtADSch.exe is the simplest way to extend the schema, and in SMS 2003, it was the only way to extend the schema. ExtADSch.exe creates the log file extadsch.log, located in the root of the system drive (%systemdrive%), which lists all schema modifications it has made and the status of the operation. After the list of attributes and classes that have been created, the log should contain the entry “Successfully extended the Active Directory schema.”

Using LDIFDE

LDIFDE is a powerful command-line utility for extracting and updating directory service data on Active Directory servers, beginning with Windows 2000. LDIFDE provides command-line switches, allowing you to specify a number of options, including some you may want to use when updating the schema for ConfigMgr. Table 3.1 includes the options that you are most likely to use.

Table 3.1. LDIFDE Command-Line Switches and Descriptions

image

The options vary slightly, depending on the Windows Server version you are running. You can see a complete listing of LDIFDE syntax by entering the following command:

ldifde /?


You can also find detailed information about using LDIFDE at http://technet2.microsoft.com/windowsserver2008/en/library/8fe5b815-f89d-48c0-8b2c-a9cd1d6986521033.mspx?mfr=true. A typical command to update the schema for ConfigMgr would be something like this:

image

The verbose logging available with LDIFDE includes more detail than the log file generated by ExtADSch.exe. The ConfigMgr_ad_schema.ldf file allows you to review all the intended changes before they are applied. You can also modify the LDF file to customize the schema extensions. As an example, you can remove the sections for creating classes and attributes that already exist as an alternative to using the –k switch referred to in Table 3.1.

Caution

Be Careful when Editing the LDF File

Do not attempt to edit the LDF file unless you have a thorough understanding of LDF, and remember to test all modifications before applying them to your production environment.

Extending the Schema

Each AD forest has a single domain controller that has the role of schema master. All schema modifications are made on the schema master. To modify the schema, you must log on using an account in the forest root domain that is a member of the Schema Admins group.

Note

About the Schema Admins Group

The built-in Schema Admins group exists in the root domain of your forest. Normally there should not be any user accounts in the Schema Admins group. You should only add accounts to the Schema Admins temporarily when you need to modify the schema. Exercising this level of caution will protect the schema from any accidental modifications.

The ConfigMgr 2007 schema modifications create four new classes and 14 new attributes used with these classes. The classes created represent the following:

Management points— Clients can use this information to find a management point.

Roaming boundary ranges— Clients can use this information to locate ConfigMgr services when they connect to the network at a location not within the boundaries of their assigned site.

Server locator points (SLPs)— Clients can use this information to find an SLP.

ConfigMgr sites— Clients can retrieve important information about the site from this AD object.

Chapter 6 describes the Management Point and Server Locator Point server roles.

Note

Schema Extensions and ConfigMgr 2007 Updates

There are no changes to the schema extensions from the RTM (Release to Manufacturing, or initial release) version of Configuration Manager 2007 in either Service Pack (SP) 1 or Release 2 (R2) (it is unknown at the time of writing this chapter whether SP 2 will incorporate schema changes). The ConfigMgr schema extensions include previous changes from the SMS 2003 version of the schema extensions.

Although you can deploy ConfigMgr with only the SMS 2003 schema extensions applied to AD, you will not have all the functionality provided by the ConfigMgr schema extensions. Configuration Manager features not supported by the SMS 2003 Schema extensions include Network Access Protection and native mode security. The “Benefits of Extending Active Directory” section of this chapter discusses these features.

Viewing Schema Changes

If you are curious about the details of the new classes, you can use the Schema Management Microsoft Management Console (MMC) snap-in to view their full schema definitions. Before adding the snap-in to the management console, you must install it by running the following command from the command prompt:


regsvr32 schmmgmt.dll


After installing the snap-in, perform the following steps to add Schema Management to the MMC:

  1. Select Start, choose Run, and then enter MMC.
  2. Choose Add/Remove snap-in from the File menu of the Microsoft Management Console.
  3. Click the Add button and then choose Active Directory Schema.
  4. Choose Close and then click OK to complete the open dialog boxes.

The left pane of the schema management tool displays a tree control with two main nodes—classes and attributes. If you expand out the classes node, you will find the following classes defined by ConfigMgr:

• mSSMSManagementPoint

• mSSMSRoamingBoundaryRange

• mSSMSServerLocatorPoint

• mSSMSSite

Clicking a class selects it and displays the attributes associated with the class in the right pane. The list of attributes for each class includes many attributes previously defined in Active Directory, in addition to those attributes specifically created for ConfigMgr 2007. You can right-click a class and choose Properties to display its property page. As an example, Figure 3.1 shows the general properties of the mSSMSSite class. You can see an explanation of these properties by clicking the Help button on the Properties page.

Figure 3.1. General properties of the schema class representing ConfigMgr sites

image

You can see the 14 ConfigMgr attributes under the Attributes node in the schema management console. The names of each of these attributes start with mS-SMS. You can right-click an attribute and choose Properties to display its property page. Figure 3.2 shows the properties of the mS-SMS-Capabilities attribute.

Figure 3.2. General properties of the schema attribute representing site capabilities

image

Tip

Verifying the Schema Extensions

Check ExtADSch.log for failures. Seeing the Event IDs 1137 in the Directory Service Event Log alone is not confirmation that the schema was extended properly; several experiences in the field have found what seemed to be a successful schema extension to show failures in the log file.

Additional Tasks

After extending the schema, you must complete several tasks before ConfigMgr can publish the objects it will use to Active Directory:

• Creating the System Management container where the ConfigMgr objects will reside in AD. If you previously extended the schema for SMS, the System Management container will already exist. Each domain publishing ConfigMgr data must have a System Management container.

• Setting permissions on the System Management container. Setting permissions allows your ConfigMgr site servers to publish site information to the container.

• Configuring your sites to publish to AD.

The next sections describe these tasks.

Creating the System Management Container

You can use the ADSIEdit MMC tool to create the System Management AD container. If you do not already have ADSIEdit installed, you can install the tool yourself. The steps to install ADSIEdit will vary depending on the version of Windows Server you are running.

On Windows Server 2008, add ADSIEdit using Server Manager. Note that configuring the domain controller server role automatically adds ADSIEdit to the Administrative Tools program group.

To install ADSIEdit on Windows Server 2003 or Windows 2000 Server, perform the following steps:

  1. Run the Windows Installer file at SUPPORTTOOLSsuptools.msi from the Windows Server 2003 installation media. (For Windows 2000 systems, the installer file is adminpak.msi.)
  2. Select Start, choose Run, and then enter MMC.
  3. Choose Add/Remove snap-in from the File menu.
  4. Click the Add button and choose ADSI Edit.
  5. Choose Close and then click OK to complete the open dialog boxes.

To create the System Management container from ADSIEdit, perform the following steps:

  1. Right-click the Root ADSI Edit node in the tree pane, select Connect to..., and then click OK to connect to the default name context.
  2. Expand the default name context node in the tree pane. Then expand the node showing the distinguished name of your domain (this will begin with DC=<domain name>) and right-click CN=System node.
  3. Select New and then choose Object.
  4. Select Container in the Create Object dialog box and click Next.
  5. Enter the name System Management and then click Next and Finish, completing the wizard.

Figure 3.3 shows ADSIEdit with the tree control expanded to the CN=System node and the Create Object dialog box displayed.

Figure 3.3. Using ADSIEdit to create the System Management container

image

Setting Permissions on the System Management Container

You can view the System Management container and set permissions on it using the Active Directory Users and Computers (ADUC) utility in the Windows Server Administrative Tools menu group. After launching ADUC, you need to enable the Advanced Features option from the View menu. You can then expand out the domain partition and System container to locate System Management.

By default, only certain administrative groups have the rights required to create and modify objects in the System Management container. For security reasons, you should create a new group and add ConfigMgr site servers to it, rather than adding them to the built-in administrative groups. Perform the following steps to grant the required access to the ConfigMgr site server security group:

  1. Right-click the System Management container, choose Properties, and then select the Security tab.
  2. Click the Add button and select the group used with your ConfigMgr site servers, as shown in Figure 3.4.

    Figure 3.4. Selecting the Site Server security group

    image
  3. Check the box for Full Control as displayed in Figure 3.5, and choose OK to apply the changes.

    Figure 3.5. Assigning permissions to the System Management container

    image

Configuring Sites to Publish to Active Directory

Perform the following steps to configure a ConfigMgr site to publish site information to AD:

  1. Navigate to System Center Configuration Manager -> Site Database -> Site Management -> <Site Code> in the ConfigMgr console (select Start -> All Programs -> Microsoft Configuration Manager to open the Configuration Manager console).
  2. Right-click the site code and choose Properties. Click the Advanced tab and then select the Publish this site in Active Directory Domain Services check box as shown in Figure 3.6. Choose OK to apply your changes.

    Figure 3.6. Configuring a site to publish to AD

    image

After extending the schema and taking the other steps necessary to enable your sites to publish to AD, you should see the ConfigMgr objects displayed in the System Management container. Figure 3.7 shows the ConfigMgr objects viewed in Active Directory Users and Computers.

Figure 3.7. The System Management container displayed in Active Directory Users and Computers

image

Benefits of Extending Active Directory

Once you extend the Active Directory schema and perform the other steps necessary to publish site information to AD, clients in the same AD forest as your ConfigMgr sites can query AD to locate Configuration Manager services and retrieve important information about your ConfigMgr sites. Those clients in workgroups and domains without trust relationships are not able to take advantage of the schema extensions.

The following ConfigMgr features require extending the AD schema and publishing site information to AD:

Global roaming— Roaming in ConfigMgr allows clients such as laptop computers to connect to the network at various locations and receive certain services from the local site. The schema extensions allow a client to query AD for the mSSMSRoamingBoundaryRange objects and determine whether a site exists on the IP subnet of their current network location. This is known as global roaming. Without the schema extensions, clients can only receive services when at their assigned site or roaming to the sites below their assigned site in the ConfigMgr hierarchy.

Global roaming can make content available to clients at network locations where it would otherwise not be available. Global roaming can also prevent unnecessary network traffic otherwise caused by those clients at remote locations requiring services from their assigned site. For more information about global roaming, see Chapter 12.

Network Access Protection— You can use ConfigMgr’s NAP capabilities to prevent clients that do not comply with specified security patch requirements from connecting to the network. NAP requires the client to retrieve health state reference information stored in the attributes of the mSSMSSite AD object. Chapter 15 discusses Network Access Protection in detail.

ConfigMgr clients can also receive a number of services through the extended schema that may be available in other ways. Chapter 12 discusses many of these features. In each case, the alternatives are more difficult to implement and some require extensive manual effort. You can use the schema extensions for the following capabilities:

Client site assignment— To receive ConfigMgr services, you must first assign a client system to a site. The schema extensions provide an option for the client to retrieve the information from AD that it needs to identify and contact its assigned site.

Client installation properties— A number of configurable options, such as the size of the download cache, are available through the extended schema.

Site mode settings— The extended schema can supply information to the client about the site’s security mode and certificate information required for native sites.

Server locator point and management points— Clients can use Active Directory to identify the server locator point and management points. Without the schema extensions you must provide this information in other ways, such as manually creating special Windows Internet Naming Service (WINS) entries.

Custom Transmission Control Protocol (TCP)/Internet Protocol (IP) Port information— If a site has been configured to use nonstandard ports for client communications, this information can be provided through the schema extensions. See Chapter 5, “Network Design,” for a discussion of port customization.

In addition, the schema extensions allow for automated public key exchange, thus facilitating site-to-site communication. If you have clients assigned to your central site and do not have the schema extended, recovery from a site failure can require reprovisioning all clients manually using the trusted root key.

The AD schema extensions are a key enabling technology for Configuration Manager. You should extend the schema and take the other steps previously listed in the “Schema Extensions” section of this chapter to publish site information to Active Directory, if this is possible.

Configuration Manager and WMI

If the SQL Server database is the heart of Configuration Manager, WMI is its lifeblood. Windows Management Instrumentation has been the core management infrastructure for all Windows desktop and server operating systems beginning with Windows 2000, and it’s available for download for use with earlier versions of Windows. WMI is the Windows implementation of Web-Based Enterprise Management (WBEM). WBEM is a set of standards intended to provide the basis for cross-platform interoperability of technologies to exchange management data and access management interfaces across distributed computing environments.

The Distributed Management Task Force (DMTF) supports WBEM. This group is an industry consortium created to promote standardization and integration of enterprise and Internet management technology. For more information about WBEM in general and the DMTF, see http://www.dmtf.org/about/faq/general_faq. Although much of the architectural material in this chapter is common to all implementations of WBEM, the next sections exclusively focus on WMI and its role in Configuration Manager, as follows:

WMI architecture— This includes describing the WMI feature set, reviewing the major components of WMI, and discussing how they interact.

WMI object model— The WMI object model and its implementation are discussed, with several tools you can use for managing WMI and looking into its inner workings.

ConfigMgr use of WMI— Configuration Manager’s use of WMI is discussed, with how you can look inside ConfigMgr through its WMI interfaces.

WMI Feature Set and Architecture

WMI serves as an abstraction layer between management applications and scripts and the physical and logical resources they manage. WMI exposes managed resources through a COM (Component Object Model) API (application programming interface). Programs written in C/C++ can call these resources directly, or you can access them through intermediate layers from applications such as scripts, Windows forms, or web forms. WMI presents a consistent and extensible object model to represent a wide variety of system, network, and other resources.

Using an object model removes much of the complexity that would otherwise be required to access and manipulate these resources. Some examples of resources you can manage through WMI include hardware devices, running processes, the Windows file system and Registry, and applications and databases.

You can invoke WMI services in several ways:

• Locally on a machine

Remotely through a DCOM (Distributed COM) connection

• Remotely using a WS-Management (Web Services for Management) connection

Configuration Manager 2007 uses all three of these access methods to connect to WMI. Chapter 5 describes the use of DCOM in ConfigMgr and the network protocols used for DCOM connections.

WS-Management is a Simple Object Access Protocol (SOAP)–based specification published by the DMTF. SOAP is a standard for invoking objects remotely over a Hypertext Transfer Protocol (HTTP) or Hypertext Transfer Protocol over Secure Socket Layer (HTTPS) connection. The main advantage of SOAP is that it works across many existing network firewalls without requiring additional configuration. A complete description of WS-Management and related specifications can be found at http://www.dmtf.org/standards/wsman.

The ConfigMgr Out of Band (OOB) management point and OOB console use WS-Management to connect to the OOB management controller on systems equipped with Intel vPro technology. Chapter 6 discusses OOB Management in detail.

WMI supports requests from management applications to

• Retrieve or modify individual data items (properties) of managed objects;

• Invoke actions (methods) supported by managed objects;

• Execute queries against the data set of managed objects;

• Register to receive events from managed objects.

Figure 3.8 shows the basic data flow in WMI:

  1. Management applications submit a request to the WMI infrastructure, which passes the request to the appropriate provider.
  2. The provider then handles the interaction with the actual system resources and returns the resulting response to WMI.
  3. WMI passes the response back to the calling application. The response may be actual data about the resource or the result of a requested operation.

Figure 3.8. How WMI accepts a request from a management application and returns a response from a managed resource

image

WMI Providers

WMI providers are analogous to device drivers in that they know how to interact with a particular resource or set of resources. In fact, many device drivers also act as WMI providers. Microsoft supplies several built-in providers as part of Windows, such as the Event Log provider and File System provider. You will see providers implemented in the following ways:

• As DLLs (Dynamic Link Libraries)

• As Windows processes and services

Just as the WMI infrastructure serves management applications through a COM interface, providers act as COM servers to handle requests from the WMI infrastructure. When a provider loads, it registers its location and the classes, objects, properties, methods, and events it provides with WMI. WMI uses this information to route requests to the proper provider.

The WMI Infrastructure

Figure 3.9 displays the main logical components of the WMI infrastructure. The core of the WMI infrastructure is the Common Information Model Object Manager (CIMOM), described in the “Inside the WMI Object Model” section of this chapter. CIMOM brokers requests between management applications and WMI providers, and communicates with management applications through the COM API, as described earlier in the “WMI Feature Set and Architecture” section. CIMOM also manages the WMI repository, an on-disk database used by WMI to store certain types of data. Beginning with Windows XP, WMI also includes an XML (eXtensible Markup Language) encoder component, which management applications and scripts can invoke to generate an XML representation of managed objects.

Figure 3.9. The major WMI infrastructure components

image

Most files used by WMI are stored on the file system by default under the %windir%System32Wbem folder. The executable containing the WMI service components is Winmgmt.exe. The physical implementation of the WMI infrastructure varies, depending on the version of Windows you are running. In Windows NT and Windows 2000, Winmgmt runs as a separate Windows service. In these earlier versions of Windows, WMI providers are loaded into the Winmgmt process space, which means that a fault in one provider can crash the entire WMI process. This can cause repository corruption, which is a common cause of WMI problems in earlier Windows implementations. Using a single process space also means that providers share the security context of the Winmgmt process, which is generally the highly privileged Local System account.

Newer versions of Windows achieve greater process isolation by loading providers into one or more instances of WMIPrvse.exe. All WMI service components beginning with Windows XP run inside shared service host (SVCHOST) processes. Windows Vista introduced several significant enhancements in WMI security and stability, including the ability to specify process isolation levels, security contexts, and resource limits for provider instances. The next section of this chapter discusses WMI security. These enhancements are also available as an update for Windows XP and Windows Server 2003 systems at http://support.microsoft.com/kb/933062.

Configuration parameters for the WMI service are stored in the system Registry subtree HKEY_LOCAL_MACHINESoftwareMicrosoftWBEM. The WMI repository is a set of files stored under %windir%System32Wbem. The exact file structure varies slightly depending on the Windows version. WMI uses a customized version of the Jet database engine to access the repository files.

WMI also provides detailed logging of its activities. Prior to Windows Vista, log entries were written in plain text to files in the %windir%System32Wbemlogs folder. In Windows Vista and Windows Server 2008, most of these logs no longer exist, and Windows Event Tracing makes log data available to event data consumers, including the Event Log Service. By default, event tracing for WMI is not enabled. The “Managing WMI” section of this chapter discusses logging and event tracing options for WMI in. Some WMI providers, such as the ConfigMgr provider, also log their activity. The “Status Messages and Logs” section discusses logging by the ConfigMgr WMI provider.

Managing WMI

This section is intended to illustrate the options available for configuring WMI rather than as a “how-to” guide to administering WMI. You will rarely need to modify the WMI settings directly during day-to-day ConfigMgr administration. However, understanding the available options will help you understand the inner workings and functionality of WMI.

The Windows WMI Control is a graphical tool for managing the most important properties of the WMI infrastructure. Only members of the local Administrators group can use the WMI Control. To run this tool, perform the following steps:

  1. Launch the Computer Management MMC snap-in. The exact procedure will vary depending on the version of Windows you are running. Generally you can right-click Computer or My Computer, and choose Manage.
  2. Expand the Services and Applications node in the tree pane.
  3. Right-click WMI Control and choose Properties.

The WMI Control opens to the General tab. As shown in Figure 3.10, the General properties confirm you have successfully connected to WMI on the local machine, display a few basic properties of your system, and specify the installed version of WMI.

Figure 3.10. The General tab of the WMI Control showing a successful connection to WMI on the local machine

image

Note

About Managing WMI on a Remote Machine

You can use the WMI Control tool to manage WMI on the local machine or on a remote machine. To connect to WMI on a remote machine, you follow the same procedure previously described in this section, with one additional step. Immediately after step 1, right-click the Computer Management node at the top of the tree and choose Connect to another computer. Then enter the name or IP address of the computer you want to manage and click OK. After connecting to the remote machine, complete steps 2 and 3 in the procedure.

Note that in addition to administrative privilege on the remote machine, you will need appropriate DCOM permissions (described later in this section). Also, DCOM network protocols must not be blocked on the remote machine or on any intermediary devices.

You can manage WMI security from the Security tab of the WMI Control tool. WMI uses standard Windows access control lists (ACLs) to secure each of the WMI namespaces that exist on your machine. A namespace, as described more precisely in the “Inside the WMI Object Model” section of this chapter, is a container that holds other WMI elements. The tree structure in the Security tab shows the WMI namespaces, as displayed in Figure 3.11.

Figure 3.11. The Security tab of the WMI Control tool, displaying the top-level WMI namespaces

image

It is important to note that the namespace is the most granular level in which to apply ACLs in WMI. The process of setting security on WMI namespaces, and the technology behind it, is very similar to the process of setting NTFS (NT File System) security. If you click a namespace to select it and click Security, you will see a dialog box similar to the one displayed in Figure 3.12.

Figure 3.12. The WMI Security dialog box for the CCM namespace (the root namespace of the ConfigMgr client)

image

The dialog box in Figure 3.12 allows you to add security principals to the discretionary ACL (DACL) of the WMI namespace. The DACL specifies who can access the namespace and the type of access they have. Prior to Windows Vista, this was the only namespace access control implemented in WMI. The Vista WMI enhancements, mentioned previously in the “WMI Feature Set and Architecture” section of this chapter, add a system access control list (SACL) for WMI namespaces. The SACL specifies the actions audited for each security principal.

Tip

About Auditing

As with other auditing of object access in Windows, auditing access to WMI namespaces requires the effective value of the group policy setting Audit Object Access to be enabled. The Windows Security event log records the events specified in the auditing settings.

To specify auditing on a WMI namespace, perform the following steps:

  1. From the Security dialog box shown in Figure 3.12, click the Advanced button.
  2. In the Advanced Security Settings dialog box, click the Auditing tab.
  3. Click the Add button and then enter the name of the user, group, or built-in security principal (see Figure 3.13). Click OK.

    Figure 3.13. Specifying a user, computer, or group for WMI control security

    image
  4. Complete the selections in the Auditing Entry dialog box and click OK.

Figure 3.14 shows the entries to enable auditing for all access failures by members of the ConfigMgr Site Servers group.

Figure 3.14. The WMI Auditing Entry dialog box displaying auditing enabled for all access failures by members of the ConfigMgr Site Servers group

image

The remaining tabs of the WMI Control tool allow you to change the default namespace for WMI connections, and they provide one of several methods of backing up the WMI repository. Windows system state backups also back up the repository. Prior to Windows Vista, the WMI Control tool also contained a logging tab that allowed you to specify verbose, normal, or no logging, as well as choose the WMI log location and maximum log size. In Windows Server 2008 and Vista, you can enable logging and configure log options in the Windows Event Viewer.

To enable WMI Trace Logging in Windows 2008 and Vista, perform the following steps:

  1. Open Event Viewer.
  2. On the View menu, select Show Analytic and Debug Logs.
  3. In the tree control, expand Applications and Service Logs -> Microsoft -> Windows -> WMI Activity.
  4. Right-click Trace and then select Enable Log from the context menu. Choosing Properties from the same menu allows you to configure logging properties for WMI. You will now be able to view, filter, and manage the WMI log from this node in the Event Viewer tree.

You can read more about WMI Logging at http://msdn.microsoft.com/en-us/library/aa394564(VS.85).aspx.

You should be aware that User Account Control, also introduced in Windows Vista, applies to privileged WMI operations. This can affect some scripts and command-line utilities. For a discussion of User Account Control and WMI, see http://msdn.microsoft.com/en-us/library/aa826699(VS.85).aspx.

Additional command-line tools are available for managing WMI, which you can download from http://msdn.microsoft.com/en-us/library/aa827351(VS.85).aspx.

Tip

Using the WMIDiag Utility

SMS was one of the first applications to take advantage of WMI. At one time, SMS was often the only WMI management application running on many Windows machines. In those days, it was a common practice among SMS administrators to simply delete the repository when WMI errors were detected, and then restart WMI to re-create the repository. This is no longer a safe practice, because many applications depend on data stored in the repository. Moreover, WMI errors can result from many other problems in your environment and may have nothing to do with WMI itself.

Rather than deleting the repository, you should obtain the WMI Diagnosis Utility (WMIDiag) from the Microsoft download site (http://www.microsoft.com/downloads/details.aspx?familyid=d7ba3cd6-18d1-4d05-b11e-4c64192ae97d&displaylang=en, or go to www.microsoft.com/downloads and search for WMIDiag). WMIDiag can help you diagnose most WMI problems, and in many cases it provides detailed instructions on how to correct those problems.

Inside the WMI Object Model

The DMTF’s Common Information Model (CIM) is the basis for the WMI object model. CIM defines a core model that provides the basic semantics for representing managed objects, and describes several common models representing specific areas of management, such as systems, networks, and applications. Third parties develop extended models, which are platform-specific implementations of common classes. You can categorize the class definitions used to represent managed objects as follows:

Core classes represent general constructs that are applicable to all areas of management. The Managed Element class is the most basic and general class and is at the root of the CIM class hierarchy. Other examples of core classes include

• Component

• Collection

• Statistical Information

Core classes are part of the core model and are the basic building blocks from which other classes are developed.

Common classes represent specific types of managed objects. Common classes are generalized representations of a category of objects, such as a computer system or an application. These classes are not tied to a particular implementation or technology.

Extended classes are technology-specific extensions of common classes, such as a Win32 computer system or Configuration Manager.

WMI classes support inheritance, meaning you can derive a new class from an existing class. The derived class is often referred to as a child or subclass of the original class. The child class has a set of attributes available to it from its parent class. Inheritance saves developers the effort of needing to create definitions for all class attributes from scratch. Developers of a child class can optionally override the definition of an inherited attribute with a different definition better suited to that class. A child class can also have additional attributes not inherited from the parent.

Typically, core and common classes are not used directly to represent managed objects. Rather, they are used as base classes from which other classes are derived. The “Looking Inside the CIMV2 Namespace” section of this chapter presents an example of how a class inherits attributes from its parent class.

A special type of WMI class is the system class. WMI uses system classes internally to support its operations. They represent providers, WMI events, inheritance metadata about WMI classes, and more.

WMI classes support three types of attributes:

Properties are the characteristics of the managed objects, such as the name of a computer system or the current value of a performance counter.

Methods are actions that a managed object can perform on your behalf. As an example, an object representing a Windows service may provide methods to start, stop, or restart the service.

Associations are actually links to a special type of WMI class, an association class, which represents a relationship between other objects. The “Looking Inside the CIMV2 Namespace” section examines the associations that link a file share security descriptor to the share and to the security principals specified in its access control lists.

You can also modify WMI classes, properties, and methods by the use of qualifiers. A qualifier on a class may designate it as abstract, meaning the class is used only to derive other classes and no objects of that class will be instantiated. Two important qualifiers designate data as static or dynamic:

Static data— Supplied in the class or object definition and stored in the WMI repository

Dynamic data— Accessed directly through the provider and represents live data on the system

The CIM specification also includes a language for exchanging management information. The Managed Object Format (MOF) provides a way to describe classes, instances, and other CIM constructs in textual form. In WMI, MOF files are included with providers to register the classes, properties, objects, and events they support with WMI. The information in the MOF files is compiled and stored in the WMI repository. Examples of information in MOF format are included throughout the chapter.

Tip

Acronym Usage

Chapter 1, “Configuration Management Basics,” discussed the Microsoft Operations Framework, often referred to as MOF. There is no relationship between the Microsoft Operations Framework and Managed Object Format, although both use the same acronym.

Namespaces organize WMI classes and other elements. A namespace is a container, much like a folder in a file system. Developers can add objects to existing namespaces or create new namespaces. As already seen in the “Managing WMI” section, the Root namespace defines a hierarchy organizing the namespaces on a system. The “Managing WMI” section also mentions that the WMI Control tool allows you to specify the default namespace for connections to WMI. Generally, the default namespace will be RootCIMV2. This is the namespace defining most of the major classes for Windows management. The next section looks at several of the classes in that namespace. Because Configuration Manager is all about Windows Management, it is not surprising that ConfigMgr uses this namespace extensively. ConfigMgr also defines its own namespaces, discussed in the section “Looking Inside Configuration Manager with WMI.”

This section covers the major concepts of WMI and the CIM model, which will be used to look inside ConfigMgr WMI activity. If you are interested in learning about other aspects of CIM, a good place to start is the tutorial at http://www.wbemsolutions.com/tutorials/CIM/index.html. The full CIM specification can by found at http://www.dmtf.org/standards/cim/cim_spec_v22. Documentation for WMI is available at http://msdn.microsoft.com/en-us/library/aa394582.aspx.

Looking Inside the CIMV2 Namespace

Windows provides a basic tool called WBEMTest that allows you to connect to a WMI namespace and execute WMI operations. There are also a number of tools from Microsoft and third parties with more intuitive graphical interfaces for displaying and navigating WMI namespaces. This section uses the Microsoft WMI Administrative Tools to look into the RootCIMV2 namespace. These tools include the WMI CIM Studio and the WMI Object Browser. You can download the WMI Administrative Tools from http://www.microsoft.com/downloads/details.aspx?FamilyID=6430f853-1120-48db-8cc5-f2abdc3ed314&DisplayLang=en or search for WMITools at www.microsoft.com/downloads. After downloading, you will need to run the WMITools.exe executable file to install the tools.

You can use CIM Studio to explore the classes in a namespace and view the properties, methods, and associations of each class. Perform the following steps to launch CIM Studio and connect to the CIMV2 namespace:

  1. Select Start -> All Programs -> WMI Tools -> WMI CIM Studio.
  2. CIM Studio will open a web browser and attempt to run an ActiveX control. If your browser blocks the control, select the option Allow Blocked Content.
  3. Verify that rootCIMV2 displays in the Connect to namespace dialog box and then click OK. Notice that you can also browse to other namespaces on the local computer of a remote computer.
  4. Click OK to accept the default logon settings.

When you open CIM Studio and connect to a namespace, the Class Explorer in the left pane contains a tree structure that displays the base classes in the selected namespace. Figure 3.15 displays the left pane with some of the root classes of the CIMV2 namespace.

Figure 3.15. The root classes of the CIMV2 namespace displayed in CIM Studio

image

Notice that most of the class names in Figure 3.15 begin with CIM or Win32. Class names starting with CIM indicate that the class is one of the core or common classes defined in the DMTF CIM schema. Extended classes are those classes with names beginning with Win32, which are part of the Win32 schema defined by Microsoft for managing the Win32 environment.

The Win32_LogicalShareSecuritySetting class

This section uses the Win32_LogicalShareSecuritySetting class to illustrate how you can use CIM Studio to understand a class of managed objects. Figure 3.16 shows the Win32_LogicalShareSecuritySetting class displayed in CIM Studio. This class represents the security settings on a Windows file share. The expanded tree shows the root class, CIM_Setting, and the classes derived from each successive subclass.

Figure 3.16. The Win32_LogicalShareSecuritySetting class displayed in CIM Studio

image

Looking at the tree structure, you can see that Win32_LogicalShareSecuritySetting is derived from Win32_SecuritySetting, which in turn is derived from CIM_Setting. The Class View in the right pane displays the properties of the Win32_LogicalShareSecuritySetting class. To the left of each property name you will see one of the following icons:

• A yellow downward-pointing arrow indicates the property is inherited from the parent class.

• A property page indicates the property is defined within the class.

• A computer system indicates that the property is a system class. You can also recognize system classes by their names, which always start with a double underscore (__).

As an example, each WMI class has certain System properties, such as __PATH, __DYNASTY, __SUPERCLASS, and __DERIVATION. Here are some points to keep in mind:

• The __PATH property shows the location of the class in the namespace hierarchy. Management applications and scripts use the __PATH property to connect to the class.

• __DYNASTY, __SUPERCLASS, and __DERIVATION are all related to class inheritance and represent the root class from which the class is derived, its immediate parent, and the entire family tree of the class, respectively.

Clicking the Array button next to __DERIVATION displays the array of parent classes from which the class is derived. The array is essentially the inheritance information already observed by traversing the tree, as shown in Figure 3.17.

Figure 3.17. The array of classes from which the Win32_LogicalShareSecuritySetting class is derived, as displayed in CIM Studio

image

The remaining properties of Win32_LogicalShareSecuritySetting are the ones that actually represent characteristics describing instances of Windows file share security settings. You can see that except for the name, all of these properties are inherited. An object that has nothing unique about it except its name would not be very interesting, but there is more to the Win32_LogicalShareSecuritySetting class than just the class properties. The most interesting attributes of Win32_LogicalShareSecuritySetting are on the remaining tabs of the CIM Studio Class View pane.

Clicking the Methods tab displays the two methods of the Win32_LogicalShareSecuritySetting class (GetSecurityDescriptor and SetSecurityDescriptor), as shown in Figure 3.18.

Figure 3.18. The Win32_LogicalShareSecuritySetting class methods, displayed in CIM Studio, allow management applications to retrieve or modify security on file shares.

image

Getting Additional Information

These methods let you work with the permissions on the actual file share. Clicking the Help button on the toolbar in the upper-right corner of Class View in Figure 3.18 provides additional information about the class.

 

Putting It All Together

The Win32_LogicalShareSecuritySetting example in the “A Sample Help Entry” sidebar shows that the GetSecurityDescriptor method returns the current security descriptor of the file share as an object of type Win32_SecurityDescriptor. The SetSecurityDescriptor method accepts a Win32_SecurityDescriptor object as input and replaces the security descriptor on the share with information supplied in the security descriptor object. The example also lists the status codes returned by these methods.

The information on the Class View Associations tab, shown in Figure 3.19, provides the key to understanding the implementation of Win32_LogicalShareSecuritySetting.

Figure 3.19. The Win32_LogicalShareSecuritySetting class associations, displayed here in CIM Studio, link the share security setting’s objects to objects representing the share and the share’s ACL entries.

image

The Win32_LogicalShareSecuritySetting Associations tab shown in Figure 3.19 displays an association with the Win32_Share class as well as associations with the two instances of the Win32_SID class. Class icons marked with a diagonal arrow represent the association classes linking other classes together. If you hover your mouse cursor over the Class icons for each of the association classes linking Win32_LogicalShareSecuritySetting to Win32_SID class instances, you can see that one is a Win32_LogicalShareAccess class instance and the other is a Win32_LogicalShareAuditing class instance.

• Instances of the Win32_LogicalShareAccess association represent access control entries (ACEs) in the DACL (that is, share permissions).

The Win32_LogicalShareAuditing instances represent ACEs in the SACL (audit settings) on the share. You can double-click any of the classes shown on this tab to navigate to it in Class View.

Because objects of the Win32_LogicalShareSecuritySetting class allow you to work with live data on the system, you would expect this to be a dynamic class. You can verify this by returning to the Properties or Methods tab, right-clicking any attribute, and selecting Object Qualifiers. The Win32_LogicalShareSecuritySetting object qualifiers are shown in Figure 3.20, including the Dynamic qualifier, which is of type Boolean with a value of True.

Figure 3.20. The Win32_LogicalShareSecuritySetting class qualifiers displayed in CIM Studio

image

From the Class View you can also use the Instances button to display all instances of the class, and you can open the properties of an instance by double-clicking it. The section “Hardware Inventory Through WMI” discusses how to use another of the WMI administrative tools, the WMI Object Browser, to view class instances. Just above the toolbar are icons that launch the MOF generator and MOF compiler wizards, as shown earlier in Figure 3.16. To launch the MOF compiler, you must check the Class icon next to the class and double-click the Wizard icon. The MOF language defining the Win32_LogicalShareSecuritySetting class is as follows:

image

The first line of the MOF entry, #pragma namespace ("\\.\ROOT\CIMV2"), is a preprocessor command instructing the MOF compiler to load the MOF definitions into the RootCIMV2 namespace. A comment block follows, which indicates the class name Class: Win32_LogicalShareSecuritySetting and the class derivation Derived from: Win32_SecuritySetting. Next, a bracketed list of object qualifiers (refer to Figure 3.20 for a GUI representation of the object qualifiers):

• The dynamic qualifier indicates that the class is dynamic and will be instantiated at runtime.

• The provider qualifier specifies that the instance provider is “SECRCW32.”

• The locale qualifier indicates the locale of the class, 1033 (U.S. English).

• The UUID qualifier is a Universally Unique Identifier for the class.

Each of these qualifiers propagates to class instances, as indicated by the toinstance keyword.

The next section contains the class declaration Win32_LogicalShareSecuritySetting : Win32_SecuritySetting. This declaration derives the Win32_LogicalShareSecuritySetting class from the Win32_SecuritySetting base class. The body of the class declaration declares locally defined class properties and methods. The Name property (the name of the share) is declared to be of type String and designated as a key value, indicating that it uniquely identifies an instance of the class. The GetSecurityDescriptor and SetSecurityDescriptor methods are both of type uint32, indicating that each method return an unsigned 32-bit integer. GetSecurityDescriptor has an output parameter of type Win32_SecurityDescriptor, whereas SetSecurityDescriptor has a corresponding input parameter of the same type. Immediately preceding each of these method definitions you will see the following method qualifiers specified:

Privileges requests the access privileges required to manipulate Win32 security descriptors.

Implemented is a Boolean value indicating the method is implemented in the class.

Valuemap specifies the method’s return values. The “A Sample Help Entry” sidebar lists the meaning of each of these values.

In addition to the locally implemented properties and qualifiers, the Win32_LogicalShareSecuritySetting class inherits properties and qualifiers defined as part of its parent class, Win32_SecuritySetting.

Before continuing, you may want to explore several other classes in the RootCIMV2 namespace:

• Work your way up the inheritance tree from the Win32_LogicalShareSecuritySetting class and see where each of the inherited properties of the class originates. In addition, notice that if you bring up the object qualifiers on the parent classes, you can see these are qualified as abstract classes.

• The immediate sibling of the Win32_LogicalShareSecuritySetting class is the Win32_LogicalFileSecuritySetting class. Notice the differences in the properties and associations for this class. Share security and file security have many characteristics in common but a few important differences. Seeing how they are both derived from the Win32_SecuritySetting class demonstrates the power and flexibility of class inheritance.

• Expand the CIM_StatisticalInformation root class and then the Win32_Perf class. The two branches of Win32_Perf show how a variety of performance counters are implemented as managed objects.

This section looked at several of the default classes in the RootCIMV2 namespace and discussed how to use CIM Studio to explore a WMI namespace. The “Hardware Inventory Through WMI” section looks at how ConfigMgr uses the classes in RootCIMV2 and adds some of its own classes.

The RootCCM Namespace

The ConfigMgr client also uses WMI for internal control of its own operations. ConfigMgr 2007 creates and uses several namespaces in addition to adding classes to the RootCIMV2 namespace.

The most important namespace created by the ConfigMgr client is the RootCCM namespace. Together with several namespaces under RootCCM, this namespace holds the configuration and policies that govern the operation of the ConfigMgr client. The hardware inventory process described in the next section of this chapter uses a policy stored in the RootCCMPolicyMachine namespace to specify what inventory data to retrieve from managed objects defined in the RootCIMV2 namespace. “The Configuration Manager Client WMI Namespace” section discusses additional uses of the RootCCM namespace.

Hardware Inventory Through WMI

ConfigMgr uses two MOF files to control hardware inventory:

SMS_Def.mof— Specifies the information reported to the management point during the client inventory retrieval cycle. The actual SMS_Def.mof file is not downloaded to the ConfigMgr client. Instead, the client receives changes to reporting class configuration as part of its machine policy. Chapter 12 discusses client policy.

Configuration.mof— Defines custom data classes the hardware inventory client agent will inventory. In addition to standard WMI classes, such as the Win32 classes, you can create data classes to provide inventory data that is accessible through WMI, such as data from the client’s system Registry. ConfigMgr clients download the Configuration.mof file as part of their machine policy retrieval cycle. Any changes are compiled and loaded into the WMI repository.

The ConfigMgr client stores its machine policy in the RootCCMPolicyMachine WMI namespace. You can use the WMI Object Browser from the WMI Administrative Tools to examine some to the inventory-related objects in this namespace. To launch the WMI Object Browser and connect to the ConfigMgr machine policy namespace, perform the following steps:

  1. Select Start -> All Programs -> WMI Tools -> WMI Object Browser.
  2. The WMI Object Browser opens a web browser and attempts to run an ActiveX control. If your browser blocks the control, select the option Allow Blocked Content.
  3. Change the entry in the Connect to namespace dialog box to RootCCMPolicyMachine and then click OK.
  4. Click OK to accept the default logon settings.

You can locate objects of a specified class by clicking the Browse button (the binocular icon on the toolbar above the left pane). As an example, select InventoryDataItem from the available classes, as shown in Figure 3.21. InventoryDataItem is the class representing inventory items specified in the machine policy. Click the Browse button to display a list of InventoryDataItem instances in the Machine Policy namespace, as shown in Figure 3.22.

Figure 3.21. Browsing for InventoryDataItem in the WMI Object Browser

image

Figure 3.22. InventoryDataItem instances listed in the WMI Object Browser

image

Figure 3.22 has the columns resized to hide the Key (1) column, which displays an object GUID (Globally Unique Identifier), and to display the more interesting information in Key (2) and Key (3).

Selecting the instance that refers to the Win32_DiskDrive class in the RootCIMV2 namespace and double-clicking this entry displays the instance properties shown in Figure 3.23. The Namespace and ItemClass properties tell the hardware inventory agent it can retrieve inventory data for this class from Win32_DiskDrive objects in the RootCIMV2 namespace.

Figure 3.23. Properties of the Win32_DiskDrive instance of the InventoryDataItem as displayed in the WMI Object Browser

image

The Properties property contains a list of properties to inventory from each instance of RootCIMV2Win32_DiskDrive. Here are the properties listed:

Availability, Description, DeviceID, Index, InterfaceType, Manufacturer, MediaType, Model, Name, Partitions, PNPDeviceID, SCSIBus, SCSILogicalUnit, SCSIPort, SCSITargetId, Size, SystemName

Win32_DiskDrive objects have many other properties besides these. If you examine the default SMS_Def.mof file that comes with ConfigMgr, you will find a section starting with the following:

image

This section is followed by a list of inventory properties available for the Win32_DiskDrive class. The properties listed here correspond to the ones designated with “SMS_Report (TRUE)” in the SMS_Def.mof file. SMS_Report is a class qualifier defined in the SMS_Class_Template class definition in SMS_Def.mof. If you change the SMS_Report qualifier on any of the available inventory properties in SMS_Def.mof on the site server, the corresponding WMI InventoryDataItem instance in the machine policy namespace is updated on the client during the next machine policy retrieval cycle.

Another InventoryDataItem instance in the RootCCMPolicyMachine namespace—Win32Reg_AddRemovePrograms—configures inventory settings for reporting on items of the Win32Reg_AddRemovePrograms class in the RootCIMV2 namespace. Unlike Win32_DiskDrive, Win32Reg_AddRemovePrograms is not a default Win32 class; it is defined in the Configuration.mof file. The following is the MOF code for Win32Reg_AddRemovePrograms:

image

When the ConfigMgr client downloads and compiles the Configuration.mof file during its machine policy retrieval cycle, WMI adds this class to the RootCIMV2 namespace. The class uses the Registry provider (RegProv) to retrieve the information stored under HKEY_LOCAL_MACHINESoftwareMicrosoftWindowsCurrentVersionUninstall in the local Registry dynamically. Each key under this location stores information about an item in Add/Remove Programs. This exposes these keys as managed objects of the newly compiled WMI class. The reporting class of the same name defined in SMS_Def.mof specifies what inventory data to report from these managed objects.

This example shows how the Configuration.mof and SMS_Def.mof files can be used together to add information from the system Registry to the ConfigMgr inventory. You can use similar methods to add data from any provider installed on the ConfigMgr client machines.

The Configuration Manager Client WMI Namespace

The Configuration Manager client creates WMI classes to represent its own components and configuration. The root of the ConfigMgr client namespace hierarchy is RootCCM. The RootCCM namespace contains classes representing client properties, such as identity and version information, installation options, and site information. Two of the classes in this namespace expose much of the functionality available through the Configuration Management Control Panel applet:

• The SMS_Client WMI class provides methods, displayed in Figure 3.24, that implement client operations such as site assignment, policy retrieval, and client repair.

Figure 3.24. The SMS_Client class with the Methods tab displayed in CIM Studio

image

• The CCM_InstalledComponent class defines properties such as name, file, and version information describing each of the installed client components. Figure 3.25 displays a list of the instances of the CCM_InstalledComponent class.

Figure 3.25. Instances of the CCM_InstalledComponent class listed in the WMI Object Browser

image

You will find managed objects for various client components in namespaces under RootCCM. Figure 3.26 shows an instance of these classes, the CacheConfig class. The CacheConfig class in the RootCCMSoftMgmtAgent namespace contains settings for the client download cache, found on the Advanced tab of the Configuration Management Control Panel applet.

Figure 3.26. The properties of the CacheConfig class instance represent the client download cache settings.

image

The ConfigMgr client uses the RootCCMpolicy namespace hierarchy to store and process policy settings retrieved from the management point. The client maintains separate namespaces for machine policy and user policy.

Tip

Using Local Client Policy

Clients normally download and apply policy defined on their assigned site as described in this section. You can choose to override downloaded policy settings on individual clients using local client policy. As an example, the Remote Tools client agent configuration is a sitewide setting, but the needs of individual client systems may vary. If your sitewide settings require a user to accept a remote control session, you may choose to use local policy to override this on servers. The ConfigMgr SDK (Software Development Kit) documentation describes how to manage local policy at http://msdn.microsoft.com/en-us/library/cc145455.aspx. Use caution when using local policy because it can complicate troubleshooting client issues.

During the policy retrieval and evaluation cycle, the policy agent, a component of the client agent, downloads and compiles policy settings and instantiates the requested policy settings in the RootCCMpolicy<machine|user>RequestedConfig namespace. The Policy Evaluator component then uses the information in RequestedConfig to update the RootCCMpolicy<machine|user>ActualConfig namespace. Based on the policy settings in the actual configuration, the Policy Agent Provider component updates various component instances with their appropriate settings. As an example, consider some of the objects used by the client to process policy for an advertisement:

The policy agent— The policy agent stores the policy for an assigned advertisement as an instance of the CCM_SoftwareDistribution class in the Rootccmpolicy<machine|user>ActualConfig namespace, as shown in Figure 3.27.

Figure 3.27. The properties of the CCM_SoftwareDistribution class instance for an advertisement to download and run Notepad

image

The Scheduler component— The Scheduler maintains history for the advertisement in a CCM_Scheduler_History object in the RootCCMscheduler namespace, as displayed in Figure 3.28.

Figure 3.28. The Scheduler uses the CCM_Scheduler_History object to maintain history for an advertisement.

image

This namespace can also contain schedule information for other components, including DCM schedules, software update schedules, and NAP schedules.

The Content Transfer Manager— The Content Transfer Management component uses the CacheInfoEx object in the RootCCMSoftMgmtAgent namespace, shown in Figure 3.29, to manage cached content for the advertisement.

Figure 3.29. The CacheInfoEx object is used to manage cached content for the advertisement.

image

The SoftwareDistributionClientConfig class— Machine policy also controls the settings of various ConfigMgr client components. The SoftwareDistributionClientConfig class, shown in Figure 3.30, contains the Software Distribution client agent settings.

Figure 3.30. Some of the properties of the SoftwareDistributionClientConfig class reflect client agent settings received from the site.

image

This section looked at some of the more important WMI classes the ConfigMgr client uses for its operations. This is by no means an exhaustive list; in fact, hundreds of classes are used by the client. The classes presented here are representative of some of the most important client operations. The Configuration Manager server components have an even larger set of WMI classes. The next section presents an overview of how ConfigMgr uses WMI for server operations.

WMI on Configuration Manager Servers

The SMS provider is a WMI provider that exposes many of the most important objects in the Configuration Manager site database as WMI managed objects. This provider is generally installed on either the site server or the site database server, discussed in Chapter 5. The ConfigMgr console and auxiliary applications such as the Resource Explorer, Service Manager, and various ConfigMgr tools are implemented as WMI management applications. Chapter 10, “The Configuration Manager Console,” discusses the ConfigMgr console. As with other WMI providers, you can also take advantage of the SMS provider’s objects in custom scripts or other management applications. The provider also implements the Configuration Manager object security model. Chapter 20, “Security and Delegation in Configuration Manager 2007,” discusses the object security model and explains how to grant users access to the console and rights on various ConfigMgr objects and classes.

The SMS provider namespace is RootSMSsite_<Site Code>. You can use standard WMI tools to view ConfigMgr classes and objects. You can also view the properties of SMS provider objects from within the ConfigMgr console. To enable viewing of WMI information, navigate to the AdminUIin folder under the main ConfigMgr installation folder and start the console with either or both of the following command-line options:

AdminConsole.msc /SMS:NamespaceView=1—This adds a ConfigMgr Namespace node to the console tree. The Namespace node displays a list of WMI classes in the ConfigMgr namespace. You can click a class name, as shown in Figure 3.31, to display its properties, qualifiers, and methods in the details pane. You can also select a property to see its associated list of property qualifiers.

Figure 3.31. The SMS_Site class as displayed in the console Namespace view

image

AdminConsole.msc /SMS:DebugView=1—This allows you to view object properties as raw WMI data. With Debug view enabled, you can right-click an object in the console tree and choose ConfigMgr Object Properties View to display the WMI properties. Notice that the default console view essentially presents the same information in a Windows dialog box. Figure 3.32 shows the WMI properties of the DAL ConfigMgr site.

Figure 3.32. The properties of the DAL site displayed in the console’s Object Properties view

image

 

Figure 3.32 displayed the property qualifiers of the Status property, showing that the status value “1” means ACTIVE.

Using the console WMI views makes exploring the SMS provider namespace much easier. To illustrate how to drill down into the underlying WMI from the console, this section uses ConfigMgr collections as an example. (Chapter 13, “Creating Packages,” and Chapter 14, “Distributing Packages,” discuss collections.) To explore the WMI behind ConfigMgr collections, perform the following steps:

  1. Enter the following command line to open the console with both the Namespace and Debug views enabled:

    AdminConsole.msc /SMS:DebugView=1 /SMS:NamespaceView=1

  2. Navigate to System Center Configuration Manager -> Site Database -> Computer Management -> Collections.
  3. Right-click the Collections node, and then choose the ConfigMgr Object Properties View. Figure 3.33 displays some of the WMI properties of the collection instances.

    • The RelPath property in column 1 provides the class name, SMS_Collection, and the name of each instance. You can use this information to locate the class and instances in CIM Studio of the WMI Object Browser. This is especially useful for those classes with names not easily guessed, such as the SMS_SIIB_Configuration class that represents many site settings.

    • The MemberClass name of the SMS_Collection instances tells you where to find additional information about the collection members.

    Figure 3.33. Some of the key properties of the ConfigMgr collections, as displayed in console’s Object Properties view

    image
  4. The /SMS:NamespaceView=1 command-line switch adds the ConfigMgr Namespace folder to the Console tree pane. Locate the SMS_Collection class under the ConfigMgr Namespace node in the console tree pane. As shown in Figure 3.34, the Namespace view provides a convenient display of class properties, methods, and qualifiers.

    Figure 3.34. The Namespace view in the ConfigMgr Collections console displays the SMS_Collection class properties, methods, and qualifiers.

    image
  5. You can use CIM Studio and the WMI Object Browser to explore the SMS_Collection class and instances further. Figures 3.35 and 3.36, respectively, show the class methods and associations in CIM Studio. The SMS_Collection class methods allow you to perform operations such as pushing the ConfigMgr Client to collection members with the Create CCRs method and updating collection membership with the RequestRefresh method. When you perform these operations through the ConfigMgr console, you are actually invoking the methods of the SMS_Collection class.

    Figure 3.35. The Methods tab of the SMS_Collection class displayed in CIM Studio

    image

    Figure 3.36. The SMS_Collection class associations link a collection to its subcollections, members, and advertisements for the collection.

    image

The Smsprov.mof file contains the MOF language defining the RootSMS namespace and the classes it contains. You can find the Smsprov.mof file in the bin<platform> folder under the Configuration Manager installation folder. You can also export MOF definitions for instances of the following ConfigMgr object types directly from the console:

• Collections

• Queries

• Reports

To export object definitions to MOF files, right-click the parent node, choose Export Objects, and complete the wizard to choose the instances to export and the file location as well as to enter descriptive text. You can use a similar process to import objects from MOF files.

This section showed how the SMS provider exposes Configuration Manager server components and database objects as WMI-managed objects. The “RootCCM Namespace,” “Hardware Inventory Through WMI,” and “The Configuration Manager Client WMI Namespace” sections discussed how the ConfigMgr client uses WMI to maintain its configuration and policy and to gather inventory data. The Configuration Manager SDK, which you can download from http://www.microsoft.com/downloads/details.aspx?FamilyID=064A995F-EF13-4200-81AD-E3AF6218EDCC&displaylang=en (or search for ConfigMgr SDK at www.microsoft.com/downloads), provides extensive documentation and sample code for using WMI to manage ConfigMgr programmatically, with managed code or scripts.

Components and Communications

Configuration Manager’s code design is based on a componentized architecture where sets of related tasks are carried out by logically distinct units of executable code, working together to implement higher-level functionality. Most Configuration Manager code resides in dynamic link libraries (DLLs) in the bin<processor architecture> folder under the Configuration Manager installation folder. Although several components run as threads of the SMS Executive service, some run as separate services. You can install all the components on the site server, or you can alternatively distribute many components to other servers.

Most of the thread components use folders known as inboxes to receive files from other components. Inboxes may consist of a single folder or a folder subtree. Components maintain open file system change-notification handles on their inboxes. When one component has work for another component to do, it drops a file in its inbox. The operating system then returns a file-change notification event to the component owning the inbox. Some components also use in-memory queues for faster communications with other components on the local machine. What’s more, some components maintain outbox folders in which they place files to be processed by other components. Many components additionally operate a watchdog cycle, in which they wake up at regular intervals to perform specific work. Unlike early SMS versions in which watchdog cycles introduced latency into various operations, time-sensitive processing does not depend on watchdog cycles.

Table 3.2 displays many of the Configuration Manager components with a description of their principal functions, the folders they use to communicate with other components, and the log files they maintain. The Component Type column indicates whether the component runs as its own process or as a thread of the Executive service, and whether or not it is monitored by the Site Component Manager. The components installed on a Configuration Manager site system will vary depending on the site roles assigned to the server and the coder revision you are running.

Table 3.2. Component Names and Descriptions

image

image

image

image

image

image

Here is additional information regarding some of the components described in Table 3.2:

• The Site Component Manager also monitors the Site Control inbox (sitectrl.box) for changes to site properties that require adding, removing, or altering a component on a site system. This is in addition to monitoring its own inbox.

• The Discovery Data Manager, Inventory Data Loader, Software Inventory Processor, and State System components maintain trusted inboxes under the inboxesauth folder for signed files.

• The Management Point File Dispatcher transfers files from its inboxes (MP outbox folders) to the inboxes of other components. To accomplish this, it uses the inboxes of the following components as its outboxes: Client Configuration Manager, Discovery Data Manager, Distribution Manager, Inventory Processor, Software Metering Processor, State System, and Status Manager.

The core components that maintain a ConfigMgr site are the Executive Service, Site Component Manager, Site Control Manager, and Site Hierarchy Manager:

• The Executive Service is the host process in which most other components run. The Executive Service exists on every ConfigMgr site system other than the site database server.

• The Site Component Manager is a separate service that configures and manages other components.

The Site Hierarchy Manager and Site Control Manager work together to maintain the site settings. Each Configuration Manager site maintains a site control file with basic configuration information. The site control file is an ASCII text file located in the Site Control Manager inbox. The site control file includes the parent site, sender addresses, client and server components, and various other site properties. For child sites, a copy of the site control file is replicated to the parent site and to all sites above it in the hierarchy. The site database contains a copy of the site control file for the current site and all direct and indirect child sites.

Caution

Do Not Edit the Site Control File Directly

The site control file is critical to the functioning of your site. Do not attempt to edit the site control file unless you are asked to do so by Microsoft support personnel. Remember to test all modifications before applying them to your production environment.

The current site control file, Sitectrl.ct0, is located in the Site Control Manager inbox. The Site Control Manager maintains a history of up to 100 versions of the site control file in the <ConfigMgr Inboxes>sitectrl.boxhistory folder. The following is an example showing how ConfigMgr components interact; here an administrator makes a change to a site property using the Configuration Manager console:

  1. The console application reads the current site control file and calculates a delta based on the settings applied by the administrator. The console code then invokes the CommitSCF method of the SMS_SiteControlFile WMI object to apply the changes in the delta site control file.
  2. The SMS provider executes the method against the database, which inserts the changes into the SiteControl table.
  3. Inserting data into the SiteControl table fires the SMSDBMON_SiteControl_SiteControl_AddUpd_HMAN_ins trigger. This creates a new entry in the TableChangeNotifications table.
  4. The Database Monitor detects the change to the database and creates a site control update file in the Hierarchy Manager inbox.
  5. The Hierarchy Manager merges the changes from the site control update file into a temporary .ct1 delta site control file. Hierarchy Manager then copies the .ct1 file to the Site Control Manager inbox.
  6. The Site Control Manager receives a file system change notification from the operating system, indicating that a new file was created in its inbox. The Site Control Manager wakes up and processes the file. After applying the changes to the old site control file, Site Control Manager copies the new site control file to three locations:

    • The main Site Control Manager (the sitectrl.box).

    • The sitectrl.boxhistory subfolder (where it is renamed using the appropriate sequential version number).

    The sitectrl.boxoutgoing folder (as a .ct2 file). Site Control Manager then copies the .ct2 file to the Hierarchy Manager inbox.

  7. Hierarchy Manager commits the changes to the site database. If the site has a parent site, the Hierarchy Manager also copies the replication manager inbox. Replication between sites is discussed next.

Figure 3.37 illustrates these steps.

Figure 3.37. Illustrating changes made to a site property

image

Most of the remaining components work together, implementing specific feature sets. An important example of this is the components related to intersite communications.

When a change occurs to the site control file at a primary site, the Hierarchy Manager initiates the process of replicating the file to other sites that need a copy of the file. This includes the parent site and any child sites affected by the change. Various other components initiate the replication of objects (such as packages, advertisements, and queries) to child primary sites and data (such as inventory and status messages) to parent sites. When a Configuration Manager component has data to replicate to another site, the following steps take place:

  1. The component with data to replicate to another site copies the file(s) to one of the subfolders of the Outbound folder in the Replication Manager’s inbox. The subfolders are named high, normal, or low to indicate the priority of the replication job. The file names begin with the destination site code for routing purposes.
  2. The Replication Manager compresses the file(s) to its process folder and moves them to its ready folder. Replication Manager then creates a job file under the Scheduler inbox.
  3. The Scheduler processes the instruction file and creates instruction and package files in the tosend folder (inboxesschedule.box osend). It then transfers the files to the appropriate sender.
  4. The sender copies the files to the SMS_SITE share on the destination site server. This share is the despooler eceive inbox.
  5. At the destination site, the Despooler validates the signature from of the source site server, decompresses the files, and moves them to the Replication Manager inbox.
  6. The Replication Manager moves the file to the appropriate inbox of the component for which the file is intended. The Replication Manager also initiates any replication to additional sites that may be required.

The “Status Messages and Logs” section of this chapter looks into the inner workings of these processes.

Inside the ConfigMgr Database

The Configuration Manager site database is a SQL Server database that contains data about your ConfigMgr infrastructure and objects, the client systems you manage, and other discovered resources. The default name of the site database is SMS_<Site Code> (where <Site Code> indicates the primary site the database is associated with). Although the exact number of objects in a ConfigMgr site database varies, there are generally several thousand objects. Management applications, including the Configuration Manager console, use WMI to access the database.

SQL Access to the Database

Microsoft’s Configuration Manager developers provide an extensive set of database views that present the underlying data tables in a consistent way. The views abstract away many of the details of the underlying table structure, which may change with future product releases. In some cases, ConfigMgr uses stored procedures in place of views to retrieve data from the tables. The reports in Configuration Manager use SQL views. Chapter 18 presents numerous examples of reports based on the SQL views. You can use the views to understand the internal structure of the database. The next sections present a subset of these views and provide information about how the views are organized and named.

Most of the Configuration Manager SQL views correspond to ConfigMgr WMI classes. In many cases, the views also reflect the underlying table structure, with minor formatting changes and more meaningful field names.

Most ConfigMgr administration tasks do not require you to work directly with SQL statements. One Configuration Manager component—ConfigMgr reporting—allows you to directly supply native SQL statements that access the site database. The ConfigMgr console also allows you to create and schedule SQL database maintenance tasks. Chapter 21, “Backup, Recovery, and Maintenance,” discusses database maintenance tasks.

Using SQL Server Management Studio

The primary user interface for administering SQL Server 2005 is the SQL Server Management Studio. To access the Configuration Manager views, perform the following steps:

  1. Launch the SQL Server Management Studio from Start -> Programs -> Microsoft SQL Server 2005 -> SQL Server Management Studio.
  2. After connecting to the site database server SQL instance, expand <servername>databaseSMS_<Site Code>views in the tree control in the left pane.

Viewing Collections

The “WMI on Configuration Manager Servers” section of this chapter looked in some detail at the Collections WMI object. The Collections WMI object provides access to the properties and methods of the Configuration Manager collections defined in the site database. The SQL view v_Collections provides access to much of the same data. Figure 3.38 shows the tree control expanded in the left pane to display the column definitions for v_Collections, whereas the view on the right displays some of the column values visible when opening the view. These columns correspond to the SMS_Collection WMI class properties, many of which were shown in Figures 3.33 and 3.34. Notice that the MemberClassName column provides the name of the view for the collection membership. These views correspond to the WMI objects specified in the MemberClassName property of the SMS_Collection WMI class.

Figure 3.38. The v_Collection SQL view displays the most important properties of the site’s Configuration Manager collections.

image

The v_Collection view is one of several views referencing Configuration Manager objects. Similar views include v_Advertisement, v_Package, and v_Report. The naming conventions for views generally map to the corresponding WMI classes, according to the following rules:

• WMI class names begin with SMS_, and SQL view names begin with v or v_.

• View names over 30 characters are truncated.

• The WMI property names are the same as the field names in the SQL views.

Site Properties

Basic Configuration Manager site properties are stored in the Sites table and exposed though several views and stored procedures. As an example, v_site displays the basic configuration of the current site and its child sites. The sysreslist table stores information about the site systems. An example of a stored procedure that retrieves data from the sites and sysreslist tables is MP_GetMPListForSite, which displays management point information for the site. The SMSData table includes additional site details, exposed through v_identification.

The tables and views discussed so far relate to the Configuration Manager objects and infrastructure. The database also contains a wealth of data gathered by various discovery methods and client inventory. Chapter 12 discusses discovery and inventory. Discovery and inventory data is stored in resource tables and presented in resource views. The naming conventions for resource views are as follows:

• Views displaying current inventory data are named v_GS_<group name>.

• Views displaying inventory history data are named v_HS_<group name>.

Views containing discovery data are named v_R_<resource type name> for data contained in WMI scalar properties and v_RA_<architecture name>_<group name> for data contained in WMI array properties.

• Inventory data for custom architectures is presented in views named v_G<resource type number>_<group name> and v_H<resource type number>_<group name>. The use of custom architectures is described in Chapter 7, “Testing and Stabilizing.”

Other Views

Several views are included that present metadata on other views and serve as keys to understanding the view schema. The v_SchemaViews view, displayed in Figure 3.39, lists the views in the view schema family and shows the type of each view.

Figure 3.39. V_SchemaViews provides a list and categorization of Configuration Manager views.

image

The following SQL statement generates the V_SchemaViews view:

image

If you examine the SQL statement, you can see that the selection criteria in the CASE statement use the naming conventions to determine the type of each view.

The v_ResourceMap view presents data from the DiscoveryArchitectures table, which defines the views representing discovery data. Table 3.3 displays the data provided by the v_ResourceMap view.

Table 3.3. The v_ResourceMap View

image

ConfigMgr uses the fields in Table 3.3 in the following manner:

• The ResourceType field is the key used throughout the resource views to associate resources with the appropriate discovery architecture.

• The DisplayName field is a descriptive name of the discovery architecture.

• The ResourceClassName indicates the view that contains basic identifying information for each discovered instance of the architecture.

As an example, the v_R_System view provides the unique Resource ID of each computer system discovered by Configuration Manager as well as basic system properties such as the NetBIOS name, operating system, and AD domain. Each resource view containing system information includes the Resource ID field, allowing you to link resources such as hard drives and network cards with the system to which they belong. Chapter 18 discusses using the Resource ID to create reports using data from multiple views.

The v_ResourceAttributeMap view displayed in Figure 3.40 presents resource attribute types extracted from discovery property definition data in the DiscPropertyDefs table.

Figure 3.40. v_ResourceAttributeMap lists the attributes used in resource views.

image

Tip

Column Names Have a “0” Appended

The ConfigMgr development team appends the column names with “0” to avoid possible conflicts with SQL reserved words.

The v_GroupMap view lists the inventory groups and views associated with each inventory architecture. Table 3.4 displays some v_GroupMap entries. Each inventory architecture represents a WMI class specified for inventory collection in the SMS_Def.mof file.

Table 3.4. The v_ GroupMap View (Partial Listing)

image

Each entry in Table 3.4 specifies the resource type, a unique GroupID, the inventory and inventory history views that present the group data, and the Management Information Format (MIF) class from which the inventory data for the group is derived.

The v_GroupAttributeMap lists the attributes associated with each inventory group, and the v_ReportViewSchema view provides a list of all classes and properties.

This section examined several of the SQL views Microsoft provides. You can learn a lot about the internal structure of ConfigMgr by using the SQL Server Management Studio to explore the database on your own. You may want to look at the views, the underlying tables, and some of the stored procedures ConfigMgr uses. The examples in this section show how you can analyze and understand these objects.

Caution

Do Not Modify the Site Database Directly

The site database is critical to the functioning of your site. Do not attempt to create, delete, or modify any database objects, or to modify data stored in the database, unless asked to do so by Microsoft support personnel. Remember to test all modifications before applying them to your production environment.

Status Messages and Logs

ConfigMgr 2007 provides two built-in mechanisms for viewing and troubleshooting Configuration Manager operations:

• ConfigMgr components generate status messages to report milestone activity and problem occurrences. System administrators can view status messages and use them in queries and reports. You can also configure the status message system to invoke automated actions in response to specified status messages.

• ConfigMgr components generate extensive logs that give additional detail about their activity.

Both the status message system and logging are highly configurable and provide valuable windows into the system.

Digging into ConfigMgr logs is the best way to gain a deep understanding of ConfigMgr internals. Much of the material in this chapter is drawn from analyzing log files. Chapter 21 covers configuring the status message system. Appendix A, “Configuration Manager Log Files,” discusses the various ConfigMgr logs in detail. Appendix A also presents log configuration options for capturing additional details of ConfigMgr component operations, including SQL statements and Network Abstraction Layer (NAL) operations. This part of the chapter discusses the use of status messages and logs for looking at the inner working of Configuration Manager.

The ConfigMgr logs are text files, and you can view them in Windows Notepad or your favorite text editor. One of the most popular tools for previous versions of SMS, however, has been the log viewer tool (Trace32). Most administrators prefer to use the log viewer rather than a text editor to display log files. An updated version of the log viewer is part of the ConfigMgr 2007 Toolkit. The log viewer formats log entries, provides search and highlighting features, and provides error lookup. You can optionally turn on an auto-refresh feature to update the displayed log in near real time.

The smsprov.log file shows calls to the SMS provider from management applications. The bottom pane of the log viewer displays the details of the highlighted log entry. The entry in Figure 3.41 shows that the user SCCMUNLEASHEDadministrator modified an instance of class SMS_SCI_SiteDefinition. The SMS_SCI_SiteDefinition, displayed in Figure 3.42, provides an interface to binary data stored in the SiteControl table.

Figure 3.41. Smsprov.log displayed in the Log Viewer (Trace32)

image

Figure 3.42. The SMS_SCI_SiteDefinition WMI class displayed in CIM Viewer

image

Note

The Configuration Manager 2007 Toolkit

Microsoft’s System Center Configuration Manager 2007 Toolkit contains a number of tools to help you manage and troubleshoot ConfigMgr 2007. You can download the Toolkit from http://www.microsoft.com/downloads/details.aspx?familyid=948e477e-fd3b-4a09-9015-141683c7ad5f&displaylang=en (or go to www.microsoft.com/downloads and search for System Center Configuration Manager 2007 Toolkit).

Figure 3.41 shows a portion of the smsprov.log file as displayed in the log viewer.

The smsprov.log file later shows the following actions performed that commit the changes to the database:

image

The log file provides additional details of the security context setup and database connection, not displayed here.

Using the SQL Server Profiler lets you see SQL requests sent to the SQL Server database. (For information about the SQL Server Profiler, see http://msdn.microsoft.com/en-us/library/ms187929.aspx.)

Tip

Using SQL Logging to Capture SQL Activity

An alternative to using the SQL Profiler to capture SQL activity is to enable SQL logging, as described in Appendix A. This will add details of SQL commands directly into the logs for components that access the database. Turning SQL logging on or off requires you to restart the Executive service.

The following SQL commands sent by ConfigMgr components show the SMS provider inserting data into the SiteControl table and the Database Monitor retrieving the change notification from the database:

image

What connects these two events is a trigger on the SiteControl table. A trigger is a special SQL procedure that fires in response to specified data-modification events. The SiteControl table defines the following trigger:

image

This trigger creates an entry in the TableChangeNotifications table each time a record is inserted in the SiteControl table. When the Database Monitor executes the spGetChangeNotifications stored procedure, it reads the TableChangeNotifications table and processes any new entries it finds.

Example: Joining a Site to a New Parent

As the smsprov.log and SQL Profiler trace were captured while joining a Configuration Manager site to a new parent site, the ParentSiteCode property was changed. Changing the parent site is a change to the site properties, which results in writing a new site control file. As described in the “Components and Communications” section of this chapter, the SMS provider initializes this operation, performed by the Site Control Manager, Site Hierarchy Manager, and the Database Monitor. The Site Control Manager and Site Hierarchy Manager generate milestone status messages when they have completed each major phase of processing the site control file updates. Table 3.5 displays these status messages.

Table 3.5. Status Messages Generated During Site Join

image

image

image

 

The third entry in Table 3.5 identified as 2814 in the Message ID column contains the following statement:

You can compare the file C:Program FilesMicrosoft Configuration Managerinboxessitectrl.boxhistory0000034.ct0 with the file C:Program FilesMicrosoft Configuration Managerinboxessitectrl.boxhistory0000035.ct0 to determine which properties changed.

Comparing these two files shows the delta entry in the new site control file, 00000035.ct0:

image

This entry indicates the change is in the Site Definition section of the file. Table 3.6 presents part of the Site Definition section of each site control file. (The parent site code entry is changed from <> to <CEN>.)

Table 3.6. Changes to the Site Configuration File

image

To capture this activity in detail, configure the logging for these three components to write to a single log file. This log provides a detailed record of how the Configuration Manager components work together to process changes to the site. The log entry displayed in Figure 3.43 shows the Database Monitor dropping an .SCU (Site Configuration Update) file in the Hierarchy Manager inbox.

Figure 3.43. The Database Monitor dropping a site configuration file (Trace32)

image

Caution

Be Careful when Combining Log Files

Configuring more than one Configuration Manager component to write to a single log file can be useful when you want to see the overall flow of an operation. The resulting log files can sometimes become overwhelming, however. Be careful when you configure this type of logging.

To see even more detail of the process activity that carries out the site modification, use Process Monitor to capture the file system activity of the SMSExec process during the site join. More information on Process Monitor and a link to download this useful tool are available at http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx.

Figure 3.44 shows the initial phase of the site join activity as displayed in the Process Monitor user interface. You can use some of Process Monitor’s filtering options to selectively display activity related to processing the site change:

• Using the ConfigMgr logs, you can determine the thread identifiers (TIDs) of the three components of interest and apply a filter to show only events from these threads.

• Filter to include only operations that access files in the ConfigMgr inbox folders.

Figure 3.44 has access to the Status Manager inbox filtered out. Components write to the Status Manager inbox to generate status messages.

• Filter out several other operations such as closing files.

Figure 3.44. Process Monitor displays file operations executed by selected Configuration Manager components.

image

Notice the NotifyChangeDirectory (directory change notifications) operations are highlighted. These initiate processing by a ConfigMgr component in response to a change to the component’s inbox folder. The first highlighted event in Figure 3.44 shows the Database Monitor (TID 2484) creating the site control update file DAL.SCU in the Hierarchy Manager inbox.

When Database Monitor creates the DAL.SCU file in the Hierarchy Manager inbox, Hierarchy Manager (TID 3420) begins reading the database for site configuration changes and preparing the delta site control (*.CT1) file.

Process Monitor can display Registry access as well as file access. You could use Process Monitor to see the details of Hierarchy Manager retrieving the Registry values it uses to construct a connection string to the site database and accessing the SQL client libraries to initiate the database connection.

The filters omit the sequence of events showing this activity. Instead, take a look at the SQL activity from the Hierarchy Manager found in the SQL Profiler data:

image

This shows the actual SQL queries Hierarchy Manager uses to retrieve data from the Sites and SiteControl tables. Hierarchy Manager uses this data to construct the delta site control file. Hierarchy Manager writes the site configuration changes to a temporary file and then executes a file-rename operation to place the delta site control file in the Site Control Manager inbox. The rename operation is the last event shown prior to the next highlighted NotifyChangeDirectory operation in Figure 3.44. At this point Hierarchy Manager logs the following single entry:

SMS_HIERARCHY_MANAGER     Processed site control changes for the local site.
7/27/2008 4:26:24 PM


Hierarchy Manager also generates the first status message shown in Table 3.5 and logs this entry:

image

The directory change notification signals to the Site Control Manager (TID 744) that it has work to do. Site Control Manager generates the following log entries to record its processing of the delta site control file (some details are omitted here):

image

image

image

image

image

image

The logs show that after detecting the delta site control file, the Site Control Manager moves the master site control file to the history folder and creates a new site control file. Site Control Manager then enumerates and validates the changes in the new file. Once the file is validated, it becomes the new master site control file and is written to the history folder as well.

In addition, Site Control Manager writes the new site control file in SMS VarFile format to the Hierarchy Manager inbox as a .CT2 file. The Hierarchy Manager updates the sites table in the database with the new site information. Hierarchy Manager then creates a .CT6 file with the site’s public key information and forwards this file to the parent site to initiate the site join. The following log entries show Hierarchy Manager updating the database and triggering replication to the new parent site:

image

image

At this point, the SQL Profiler trace shows a large amount of activity by the Site Hierarchy Manager updating the site database with information from the new master site control file. Here’s a sampling of these queries:

image

The components responsible for replicating the site change to the parent site are the Replication Manager, Scheduler, and Sender. To see how Hierarchy Manager initiates the actual site join, the next section looks at some events captured with Process Monitor. It then reviews some of the key entries from the logs from the three components involved in intersite replication.

Viewing Intersite Replication

When a component requires intersite replication services, you expect to see the component write to the Replication Manager’s inbox to initiate the replication process. Here the Process Monitor data is filtered to find events that indicate files are written to replmgr.box. The filtered data is sent to Microsoft Excel for analysis. Table 3.7 contains some events related to the site-join process.

Table 3.7. File Operations That Initiate Intersite Replication

image

Both the Status Summarizer and Hierarchy Manager create files for Replication Manager to process:

• The two Status Summarizer files are normal priority jobs and are inserted in the normal folder.

• The Hierarchy Manager job is high priority and goes in the high folder.

Replication Manager scans its inboxes, finds the files, and processes them to create jobs for the Scheduler, as the following sequence of log entries shows:

image

Process Monitor shows Replication Manager creating the .JOB file in the Scheduler’s inbox:

image

Figure 3.45 displays the log entries by the Scheduler’s initial processing of these jobs, which takes place during the next Scheduler Processing cycle.

Figure 3.45. The Log Viewer (Trace32) shows the events logged during the sender processing cycle

image

After a 10-second delay, the Scheduler processes the sending requests.

image

The following excerpts from the LAN sender log show the major phases of the sending operation. First, the sender connects to the Scheduler’s outbox (..schedule.boxoutboxesLAN) to check for sender instructions. The sender then finds the send request and establishes a connection to the destination site.

image

image

Tip

Using NAL Logging to Capture Network Connection Processing

If you are interested in seeing even more detail of ConfigMgr network activity, you can enable Network Abstraction Layer logging. Appendix A describes NAL logging.

When a site is joined to a new parent site, all site configuration, discovery, and inventory data is replicated to the parent site. The sending components continue this process until the replication is complete. Other processes not detailed here due to space considerations include the receiving end of the site join and the synchronization of objects and data between the newly joined sites.

Summary

This chapter discussed the internal working of Configuration Manager. It looked at how ConfigMgr sites publish information in Active Directory and how ConfigMgr clients use directory information. The chapter then discussed how ConfigMgr clients and servers use WMI. It examined some of the internal storage of the ConfigMgr database, and how ConfigMgr processes and threads work together to implement key features. Finally, the chapter presented an example of how you can use ConfigMgr status messages and logs along with some other tools to drill down into the inner workings of Configuration Manager.

The next chapter discusses how to leverage Configuration Manager features to design solutions and deliver value to your organization.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.149.229.253