myITforum.com Wiki Service

Powered by you!

Providers used during Configuration Manager 2007 client hardware inventory are listed at the top of the Configuration.mof file and are registered on clients when they receive the first computer policy and compile the Configuration.mof file, as part of normal computer policy, for the first time.

Overview

SMS_DEF.MOF vs. Configuration.mof

Monitoring Changes

Enabling or Disabling Existing Classes
    Enabling
    Disabling

Custom Inventory – individual registry keys

Custom Inventory – values within registry subkeys

Custom Inventory – WMI classes

Custom Inventory – HkeyCurrentUser

Sources

Edit

Overview

System Center Configuration Manager has two general inventory methods: software inventory; which is scanning for actual files on the client’s hard drive, and hardware inventory; which is scanning for registry keys, and WMI information from the client. This guide will focus on the hardware inventory piece. When installed natively, Hardware Inventory policy is preconfigured to report on many common elements an average administrator would need to know about their clients. Over time, business requirements may drive the need to know the value of specific regkeys or other values which you as an administrator know exist on your clients.

Other than editing the mof files manually, there is a 3rd party application, Inventory Manager, available from Dudeworks

Edit

SMS_DEF.MOF vs. Configuration.Mof

SMS_Def.mof is used by Configuration Manager to create the Hardware Inventory Policy. It is where you as an administrator would change TRUE to FALSE or FALSE to TRUE to enable to disable existing classes and attributes, or if you are adding custom classes, where you would paste the customizations to the bottom of the file. Configuration.mof is where you would paste customizations to the bottom of the file. Changes made to configuration.mof are picked up by the clients and automatically compiled. It where a client finds out “how” to report on custom hardware inventory requests.

Edit

Monitoring changes

Regardless of what changes you may be making, monitoring the success or failure of those changes follow a similar path.

1. Using Trace32 from the Toolkit (or other log file viewer), open up SMSServer\logs\dataldr.log

2. When you modify or add to sms_def.mof or configuration.mof, monitor dataldr.log Almost immediately upon you hitting “save” you’ll see "SMS_DEF.MOF change detected", a few lines later, if successful, "End of cimv2\sms-to-policy conversion; returning 0x0"

3. This means your modification was accepted, and the policies have been forwarded to your Management Point(s).

If your SMS site is working in general (clients can run ads, etc.) I usually trust that the policy change will make it to the MP. But if you are not that trusting, you can monitor policypv.log for “STATMSG: ID= ….{some characters}” then “Successfully updated 1 settings policy”.

4. Choose an SMS client, and using either remote tools or locally from the Configuration Manager applet, invoke a Machine Policy Retrieval. You will likely need to do this action several times, waiting ~1 minute between each attempt. This is the step where I get the most impatient.

5. 2nd log to monitor: the local client's system32\ccm\logs\policyevaluator.log, waiting for Updating policy CCM_Policy_Policy3.PolicyID="{some characters}", PolicySource="SMS:sitecode",PolicyVersion="some integer". Unless you've modified other actions, this policy will likely be the Hardware Inventory policy. Once you see this, the client has picked up the changed policy, but it’s probably not active yet. If the step below (Hardware Inventory) still doesn’t show the new class, do another Machine Policy request.

You could also use PolicySpy from the toolkit2, and look at Requested Tab, Machine, CCM_Policy_Policy3, find your {some characters} policy, and then scroll, scroll, scroll in the lower right-hand pane, and look for your newly enabled class.

6. On the same client, using either remote tools or locally from the Configuration Manager applet, invoke a Hardware Inventory Action.

7. 3rd log to monitor: the local client's system32\ccm\logs\inventoryagent.log, watching for your modification or addition Select from .

8. Back to the 1st log: Server\sms\logs\dataldr.log, watch for "Processing Inventory for Machine: . If you have a particularly busy site, you might want to use (in trace32), Tools, Filter, check 'when the entry text' Contains your Client's computer name.

9. If you are not filtering for the computer name, shortly after "File Successfuly parsed", a few entries will be made regarding “Defining group class: ” and “create procedure p, and d

10. A few minutes after that; you'll have new tables and views available for writing reports on.

11. If you have multiple Primary sites, you will need to make your change to sms_def.mof and configuration.mof within each Primary site’s inboxes\clifiles.srv\hinv folder.

Edit

Enabling/Disabling existing classes

In SMS_DEF.mof there are several pre-defined classes and attributes. Some of those classes are disabled, or set as FALSE. This is because many companies do not need to know environment variables set on their clients, etc. There are also some defaults which are set as TRUE, which perhaps in your environment you do not need to have enabled.

Edit

Disabling

1. To see if you can disable something in your environment, there are two things to look at.

2. The first is to pick several clients (including servers), and check inventoryagent.log. Specifically looking for ”… does not exist out”. An example might be if your company doesn’t use Windows Mobile Devices, you might be able to set as FALSE the ActiveSync class.

3. If you’ve determined a few candidates for disabling, create a report checking to see what computers might have ever reported on that particular class.

4. If you’ve decided that class can be disabled, edit SMS_DEF.MOF, and find that class. Change the TRUE to FALSE at the top of that section. Follow the Monitoring Changes section.

5. The second way to determine if there is something you can disable is to check Resource Explorer on a couple of clients (including servers). There may be data which every client or server reports, but that information may not be of use to your organization. If you find something you know you do not need reported, find that section in SMS_DEF.MOF, and change it from TRUE to FALSE at the top of that section, and follow the Monitoring Changes section.

Edit

Cleaning up (optional)

Once you have disabled a class, you may have old tables, views, and stored procedures associated with that inventory which you no longer need. To clean out this obsolete data, there are two methods. One is to download "SiteSweeper", a free utility available at http://www.sccmexpert.com. Alternatively, here are the manual steps you could perform. You will need "delgrp", which is available in the Toolkit.

Delete Tables in SQL

• delgrp /L This lists all delete-able tables; confirm the group name visually

Using the example of TIME_ZONE,

• delgrp "MICROSOFT|TIME_ZONE|1.0" /C

/c means show me any Collections which might be based on values reported in this class. If you have collections based on this hardware inventory element, maybe you do not want to delete this. Verify there are no advertisements, etc. going to those collections, or delete the collections manually first.

• Stop the SMS Exec Service • delgrp "MICROSOFT|TIME_ZONE|1.0" • Start the SMS Exec Service

Delete Views in SQL

• Launch SQL Admin Console, and browse to the Views

• find v_GS_TIMEZONE, right-click, choose "Delete", then pick "Drop All" Repeat for v_HS_TIMEZONE

Delete stored procedures

• browse to stored procedures in the SQL admin console • scroll until you find pTime_Zone_data, rightlick, "Delete", "Drop All" • Repeat for d_Time_Zone_Data

• If you have multiple primary sites, repeat on each primary.

Edit

Enabling

Edit

Asset Intelligence classes

Within your Configuration Manager console, you can enable Asset Intelligence classes by right-clicking on "Asset Intelligence", and select "Edit Asset Intelligence Reporting Class Settings" ai1

Then select the classes you wish to enable. Note that some classes may require additional configuration. For example, console user may require a GPO. ai2

Edit

Other Existing, but currently disabled classes

1. To know what you might be missing, browse through sms_def.mof, and check what classes are set to FALSE, and determine if that might be something you would need to be able to report on.

2. One class that some people find useful is Environment variables

3. How to know what to set to TRUE:

    a. If you look at sms_def.mof and find a class you’d like to enable, there are often multiple attributes within that class. You often do not need to set to TRUE every single attribute.

    b. One way to see what is inside that WMI class is to run the following, using the example of win32_environment:

        i. Start, Run, Wbemtest

        ii. Connect, change to root\cimv2, Connect

        iii. Click ‘Enum Classes’

        iv. Leave Superclass name blank, change from Immediate to Recursive, OK

        v. Wait a few seconds for all of the classes to enumerate, then scroll down to win32_environment, and double-click.

        vi. In the middle, check “Hide System Properties”

        vii. Click ‘Instances’

        viii. For win32_environment, there will be multiple objects. For other classes, there may be only 1 object returned. Double-click one of the objects

        ix. Browse through the properties in the middle and determine which attribute(s) you would find useful in a report from Configuration Manager.

    c. For Environment Variables, in my environment I determined I would find useful Name, VariableValue, SystemVariable, and Username. Take note of the attributes you’d want to set as TRUE.

Edit

Custom Inventory – individual registry keys

Inventory specific individual registry keys, using sample keys from “Absolute Software”. This sample includes dword, binary, string, and multi-string value types.

RegistryExample

1. The reporting section, to be placed at the bottom of sms_def.mof

[SMS_Report(TRUE),
 SMS_Group_Name("Absolute Software"),
 SMS_Class_ID("CUSTOM|Absolute_Software|1.0")]
Class AbsoluteSoftware : SMS_Class_Template
{
  [SMS_Report(TRUE),key] string  KeyName;
  [SMS_Report(TRUE)]     boolean Enabled;
//NOTE: the Dword value, if it might be something other than 1, 
//could instead be a uint32 type, like
// [SMS_Report(TRUE)]    uint32  Enabled;
  [SMS_Report(TRUE)]     uint32  Value[];
  [SMS_Report(TRUE)]     string  WGFolder; 
  [SMS_Report(TRUE)]     string  WGInfo[];
  [SMS_Report(TRUE)]     string  RLVWWS;
};

2. The data section, to be placed at the bottom of configuration.mof

[DYNPROPS]
Class AbsoluteSoftware
{
  [key] string  KeyName;
       string  Default;
       boolean Enabled;
// If the dword might be other than 0 or 1
//     uint32  Enabled;
       uint32  Value[];
       string  WGFolder;
       string  WGInfo[];
       string  RLVWWS;
};
[DYNPROPS]
instance of AbsoluteSoftware
{
  KeyName = "Absolute Software";
  [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Absolute Software|Enabled"),
	Dynamic, Provider("RegPropProv")] Enabled;
  [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Absolute Software|WGFolder"),
	Dynamic, Provider("RegPropProv")] WGFolder;
  [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Absolute Software|WGInfo"),
	Dynamic, Provider("RegPropProv")] WGInfo;  
  [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Absolute Software|Value"),
	Dynamic, Provider("RegPropProv")] Value;
  [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Absolute Software\\Config|Really Long Value that we will shorten"),
	Dynamic, Provider("RegPropProv")] RLVWWS;
};

3. In Resource Explorer, the values will look like:

ResourceExplorer

Edit

Custom Inventory – values within registry subkeys

The example within the default sms_def.mof/Configuration.mof are the keys and values reported in HKLM\software\microsoft\windows\currentversion\uninstall. This type of regkey mof edit is if you do not know the name of each individual key, but the value names are exactly same—just like in the Uninstall keys. An example is if you stamp your transform.

Edit

Custom Inventory – WMI classes

There are two general WMI Classes discussions: Existing classes, and Script-created classes.

Edit

Existing classes

If you’ve browsed through WMI classes and have noted a WMI class which is not already defined in the default mof files, but it is information your organization would benefit from having as a report, you can extend HW Inventory to pull in those classes. Using either a WMI browser or wbemtest as outlined in ‘enabling/disabling existing classes’, determine which class (usually win32_something), and what attributes within that class you wish to have enabled. Note: If you wish to enable classes from a namespace other than root\cimv2, note that you will need to declare the namespace at the top of your mof edit.

Edit

Script-created classes

There are several existing scripts which are designed to run on a client computer and create and populate WMI with values. In those cases, some of the MOF edits that would normally be done in configuration.mof are defined by the script on the client, and the only edit needed is to sms_def.mof. Examples are the “dataldr” scripts from SCCMExpert.

Edit

Custom Inventory – HkeyCurrentUser

Hardware Inventory cannot pull data from the “HKCU” keys. This is because Hardware Inventory policy applies to the computer—not the interactively logged in user. If there are HKCU keys you need to gather for business reasons, one method is to run a script on the clients as a recurring advertisement, to essentially copy the values you need from HKCU to HKLM (or WMI, if you wish). Once they are in HKLM or WMI, you can now extend HW Inventory targeting HKLM or WMI for the information. Two examples of this method is here and here

Another suggestion for HKCU keys is to not use Hardware Inventory extensions at all. Depending upon what you are looking for, you could instead use Desired Configuration Management, and create a Baseline and Configuration Item which would look at values in users' registry.

Edit

Resources

Sherry Kissinger's Blog

Jeff Gilbert's Blog

Jeff Gilbert Blog #2

Troubleshooting Hardware Inventory Flow

"ConfigMgr MOF Snippets" are available in two places: On SCCMexpert.com, click on "The Mof", Mof Tools, then "Get the Scripts" (note; you may have to sign up on their web site--but it's quick & free). Then grab "ConfigMgr MOF Snippets". Or grab them from —>here<—, or create your own Mini Monster MOF

MOF Guide

Community MOF Guide

WMI Dump Information at Dudeworks.com, great for determining what to enable in the default sms_def.mof

Mini Monster Mof Builder

Dell Warranty Info - Hardware Inventory extension

Dell OMCI (Open Manage Client Instrumentation) Mof extensions



ScrewTurn Wiki version 2.0.35. Some of the icons created by FamFamFam.