Let's see here how to extend hardware inventory class for the Client Cache
By default the Client cache
details (Such as Cache Location, Cache Size, Used space) are not captured in
the hardware inventory. But we can include it to the hardware inventory by
importing the necessary WMI class.
ConfigMgr hardware inventory
reads the required information from the Windows Management
Instrumentation(WMI).
In the earlier versions of
ConfigMgr, we could extend the Hardware inventory by editing the SMS_Def.MOF
file on the site server.
In simple words, the sms_def.mof
is a text file that tells SMS what client information you are looking for when
you run a hardware inventory on a client. This MOF file is stored in the
\SMS\Inboxes\Clifiles.src\Hinv folder on the SMS site server.
In ConfigMgr2012, there is no
need to edit the SMS_Def.MOF file like the earlier versions. Instead we can enable and disable WMI
classes, Add or Import new classes to
hardware inventory by the Client Settings in the console itself.
As shown below, The Client
Cache details are present in the WMI class "CacheConfig" under
the namespace Root\CCM\Softmgmtagent\
We can also see the MOF file
and the data types of all the properties using the wbemtest. Connect to the
names space \\root\ccm\softmgmtagent
then select class "cacheconfig" and click on "show
MOF"
Same can be explored using
PowerShell also:-
Now let's try to import this
class to the Hardware inventory.
Create a text file and copy the
below content to it. Save the text file as a MOF file. For ex. ClientCache.Mof
====================================================================================================================================
//=====================================
// SMS Advanced Client Cache
Reporting Class
//=====================================
[ SMS_Report (TRUE),
SMS_Group_Name ("SMS
Advanced Client Cache"),
SMS_Class_ID ("SMS_ADVANCED_CLIENT_CACHE"),
Namespace ("\\\\\\\\.\\\\root\\\\ccm\\\\softmgmtagent") ]
class CacheConfig :
SMS_Class_Template
{
[ SMS_Report (TRUE), key ]
String
ConfigKey;
[ SMS_Report (TRUE) ]
Boolean
InUse;
[ SMS_Report (TRUE) ]
String
Location;
[ SMS_Report (TRUE) ]
UInt32
Size;
};
=======================================================================================================================================
Start the ConfigMgr
Console, Under the Administration
workspace, select the Client Settings. You will see the list of client settings
which are created in the right pane.
Always select the "Default
Client Settings" to import the new classes. You will receive errors if
you try import classes to the other customized client settings. The new changes
will automatically reflected to other custom client settings.
These changes to "Default
Client Setting" should be done at the top level hierarchy of SCCM.
Right Click on the "Default
Client Settings" and select properties
Select the Hardware
Inventory and Click on "Set Classes"
The "Hardware Inventory
Classes" will open. The Client
cache class is not present in the Inventory classes list. Click on Import
Browse the MOF file which we
had created.
Select the file and click open.
You will see the summary window as shown below. Click on Import.
You can check the progress in
the dataldr.log under \program files\Microsoft Configuration
Manager\logs\ on the site server
Once it is imported
successfully, You would see the "SMS
Advanced Client Cache( CacheConfg)" class listed in the Hardware
inventory classes
Let's deploy this setting and
verify the same on a test machine.
As i mentioned below the
changes in the Default Client Settings will automatically reflect in the other
customized client settings.
Here I selected the "SMS
Advanced Client Cache (CacheConfig) in the test client settings (Customized
one) and deployed the same to a Test machine
"Win7-client1-SA"
Made sure the
"CacheConfig" class is selected and deployed to the TestWin7 collection
which has the test machine "Win7-Client-SA"
Logged on to a Test machine
"Win7-Client1-SA" and Initiated the Hardware inventory from the
Configuration Manager client applet.
Monitor the InventoryAgent.log
at c:\windows\ccm\logs on the client machine. You would see the log entries
related to CacheConfig class.
Back to SCCM console, Open the
resource explorer for the test machine and you would see the new class
populated with the necessary information
Thanks for reading !
Happy Exploring!!
No comments:
Post a Comment