Thursday, 12 September 2013

Extending Hardware Inventory to Get Network Driver Version in SCCM2012

Extending Hardware Inventory to Get Network Driver Version:

To get additional hardware information through SCCM, we need to extend the hardware inventory in SCCM 2012.In order to extend the hardware inventory we have to make changes in the Configuration.MOF file in SCCM.


Configuration.MOF: The Configuration.MOF file is used to define the data classes to be inventoried by the hardware inventory client agent. Data classes can be created to inventory existing or custom WMI repository data classes or registry keys present on client systems.The Configuration.MOF also defines and registers the WMI providers used to access computer information during hardware inventory. Registering providers defines the type of provider to be used and the classes that the provider supports.

Path to get Configuration.MOF in SCCM 2012: C:\Program Files\Microsoft Configuration Manager\inboxes\clifiles.src\hinv.

MofComp.exe:MofComp.exe is MOF file compiler, which is use to check the errors in MOF file in order to check the extended MOF file configuration in SCCM 2012. Manually compile this modified Configuration.MOF file on a test client using MOFComp.exe
Open command prompt and type the following command to compile the Configuration.MOF file

Path for MofComp.exe: C:\Windows\System32\wbem

Syntax to use for compiling the modified MOF file: Mofcomp –Check

If there is no error after compiling your modified MOF file your output result will be as bellow:


C:\Windows\System32\wbemC:\>C:\Windows\System32\wbem\mofcomp.exe -check C:\path

Microsoft (R) MOF Compiler Version 6.1.7600.16385

Copyright (c) Microsoft Corp. 1997-2006. All rights reserved.

Parsing MOF file: C:\Users\Desktop\import.mof

MOF file has been successfully parsed

Syntax check complete.

Done!


Code used to get Network Driver version:





#pragma namespace ("\\\\.\\root\\cimv2\\sms")

[ SMS_Report (TRUE),
SMS_Group_Name ("Network Drivers"),
SMS_Class_ID ("MICROSOFT|NETWORK_DRIVERS1|1.0"),
Namespace ("\\\\\\\\localhost\\\\root\\\\cimv2") ]

class Win32Reg_NetworkDrivers1 : SMS_Class_Template
{
[SMS_Report (TRUE), key ]
string Index;
[SMS_Report (TRUE) ]
string DriverDesc;
[SMS_Report (TRUE) ]
string DriverVersion;
[SMS_Report (TRUE) ]
string DriverDate;
[SMS_Report (TRUE) ]
string MediaType;
};



Open the Configuration.MOF file from C:\Program Files\Microsoft Configuration Manager\inboxes\clifiles.src\hinv and copy the above code in the Configuration.MOF file and paste in the added extension start for that you have to drag down to the lat of MOF file


NOTE: This is extremely important that Configuration.MOF file must be backed up before making any changes.We can use MofComp.exe to debug any error realted to modified Configuration.MOF file as mentioned above.


Once we have modifed the Configuration.Mof file in the server check the Dataldr.log in the SCCM server for any errors, Now paste the above code in the text file which is used for Network Driver Extension and save it as Network Driver.MOF and import the same in the Default client setting for that we have to use below steps: Open Configuration Manager Console go to Administration->Client Settings->Default Client Setting->Right Click Properties->Hardware Inventory->Click On set Classes and import the Network Driver.MOF file.

Check logs for any issues Validate the InventoryAgent.log on the Client to see whether our class has been inventoried.Once the data is relayed to the MP and procesed there, it should appear in Resource Explorer.
rajivavande@blogspot.com