Overview
SCCM 2012 has come a long way in terms of inventory management. It has come a long way since SMS days when the MOF file had to be deployed on each client to collect the inventory. In SCCM 2007, there was a sms_DEF.mof that was required to define the WMI classes that are to be inventoried.
In SCCM 2012, the concept of hardware inventory is fairly simple. You can define any WMI classes that are to be inventoried in SCCM Console as part of Client Agent settings. These client agent settings can be advertised on collections. This means that now you have the flexibility to customize the inventory gathering based on models, operating systems, business units etc
The client then reads all inventory information through WMI (Windows Management Instrumentation). The SCCM Client agent then imports these classes when it runs the machine policy refresh cycle. Therefore, the client now polls for any changes to the configuration chages from the server.
Detailed Step by Step procedure for extending Hardware Inventory in SCCM 2012
There are 8 key steps to extend inventory in SCCM:
- Create the MOF file to extend inventory
- Make a backup of the Inboxes\CliFiles.src\HInv\Configuration.MOF file on the CAS
- Copy the contents of the MOF file between the two customer headings at the very bottom of the Configuration.MOF
- Manually compile this modified Configuration.MOF file on a test client using MOFComp
- Bring up properties of the Default Client Agent Settings on your CAS
- Select Hardware Inventory and click Set Classes
- Click Add and connect to \\WKS\root\CIMV2 (where WKS is the name of the client used above)
- Select <the class added> and press OK
- Monitor PolicyPv.log on the primary to which the client reports indicate that it has updated policy to reflect the new class
- pdate Machine Policy on the client side, allow a minute or two for that to process and then force a Hardware Inventory cycle
- Once the data is relayed to the MP and procesed there, it should appear in Resource Explorer.
Let me take a small example: We want to inventory "HKEY_LOCAL_MACHINE\SOFTWARE\Absolute Software Inc\" registry key with Esn (where Esn is a Reg_Sz or String value) |
STEP 1 - Create the MOF file to extend inventory
This is where most of us run into issues. We must ensure that the correct MOF file is created. Here is a sample code for the registry that we want to inventory.
#pragma namespace ("\\\\.\\root\\cimv2")#pragma deleteclass("Absolute_Software_Inc", NOFAIL) [DYNPROPS] Class Absolute_Software_Inc { [key] string KeyName; String Esn; }; [DYNPROPS] Instance of Absolute_Software_Inc { KeyName="Absolute Software Inc"; [PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Absolute Software Inc|Esn"),Dynamic,Provider("RegPropProv")] Esn; }; TAKE CARE OF WORD WRAP |
It is important to understand how to create this MOF file, therefore let us look at it section by section.
#pragma namespace ("\\\\.\\root\\cimv2")
You must declare the namespace into which you will be adding the new class. You use the #pragma command to inform the MOF compiler that you will be using the specified namespace to add this object to. In this example, you enumerate the root \cimv2 namespace of the local computer. This is where the information for the new provider will be located.
Note the extra backslash characters in the definition of the namespace. The first backslash character specifies a special character that follows. The second backslash character defines the special character that you want to use. This is known as "escaping" special characters so that the MOF compiler will interpret them literally.
#pragma deleteclass("Absolute_Software_Inc", NOFAIL)
The #pragma deleteclass command is used in SMS/Configuration Manager hardware inventory modification to delete class information from WMI repositories. It is recommended to use deleteclass if you are testing new hardware inventory modifications and making changes to your mof edits during testing and want to start with a clean slate each time the client compiles the new mof file. When deleting WMI classes from clients that have already performed hardware inventories (especially if you have changed a Key field), you should also delete the class information stored in the site database as well.
[DYNPROPS]
The DynProps qualifier identifies a class as having properties that are maintained by the property provider identified by the Provider qualifier
Class Absolute_Software_Inc
{
[key] string KeyName;
String Esn;
};
Here we add the class definition in the root\cimv2\sms namespace to specify inventory collection. A new Class – Absolute_Software_Inc is defined. It also defines the KeyName variable with string datatype.
[DYNPROPS]
Instance of Absolute_Software_Inc
{
KeyName="Absolute Software Inc";
[PropertyContext("Local|HKEY_LOCAL_MACHINE\\SOFTWARE\\Absolute Software Inc|Esn"),Dynamic,Provider("RegPropProv")] Esn;
};
Next we instantiate the class, and define the properties of the class that need to be inventoried. The actual registry value that is retrieved is called the Property context. This value must have the same name as the registry value that you are enumerating. The name must be enclosed in quotation marks. The display name is the name by which the data will be referenced. MOF file syntax is derived from Microsoft® Visual C++ syntax for class definitions.
Step 2 – Take a backup of the Inboxes\CliFiles.src\HInv\Configuration.MOF file on the CAS
This is extremely important. The Configuration.MOF file must be backed up before before making any changes.
STEp 3 - Copy the contents of the MOF file between the two custom headings at the very bottom of the Configuration.MOF
Open the configuration.mof file and browse to the end of the file and look for the following content:
#pragma namespace ("\\\\.\\root\\cimv2")
//========================
// Added extensions start
//========================
//========================
// Added extensions end
//========================
Copy paste the content of the MOF File created earlier between the Added extensions start.
Step 4- 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 on a TEST CLIENT.
mofcomp.exe -check Configuration.mof
This will check the syntax of the MOF File.
mofcomp.exe Configuration.mof
Step 5- Add hardware inventory in SCCM from the remote computer namespace
Open the SCCM Console On the Central Administration Site server and Click on Administration -> Client Settings -> Hardware Inventory -> Set Classes
Click on Add.
Select the Class that needs to be added and click on OK and it should show up in SCCM as well.
Step 6 - Monitor PolicyPv.log on the primary to which the client reports indicate that it has updated policy to reflect the new class
Update "Machine Policy Retrieval & Evaluation Cycle" on the client side. Allow a minute or two for that to process and then force a "Hardware Inventory" cycle.
Validate the InventoryAgent.log on the Test Client to see whether our class has been inventoried.
Similarly, policypv.log will report any updates to the inventory class.
Once the data is relayed to the MP and procesed there, it should appear in Resource Explorer.
Great Article just what I need to inventory all ODBC connections. One question though.
ReplyDeleteDo I need to compile the mof on the server as well to apply the Class to all client machines?
Or do I need to compile this new mof on every client?
Or are neither of these needed?
How would you run report in SCCM to get the ODBC connections
DeleteThis guide is to show how it is done on a test client. If you want it on all clients, then you will have to save the configuration.mof file on the primary server. (Or CAS if you use this).
ReplyDeleteThe guide states how to import/add the new inventory setting in the console (Connect to test client), and as long as the primary server has the updated configration.mof file, it will instruct the client to update their WIM namespace upon next machine policy and retrival cycle.
I really like following your blog as the articles are so simple to read and follow. Excellent. Please keep up the good work. Thanks.
ReplyDeleteI love this blog! keep up good works...its to be nice if we can know each other, do you think so? Telugu Movies
ReplyDeleteThank you very much for this article. My employer needed some manual reports and this made everything perfect without a hassle.
ReplyDeleteThank you.
This is AWESOME!!! cant thank you enough for sharing this knowledge
ReplyDeleteAwesome explanation with some wonderful screenshots...
ReplyDeleteGreat article, helped me populate our MOF file with the exchange server details we needed within our environment. Thanks again!
ReplyDeleteI've created a WMI Class to fetch data & would like to know the process to add the WMI Class in the MOF file?
ReplyDeleteit was a wonderful chance to visit this kind of site and I am happy to know. thank you so much for giving us a chance to have this opportunity.. Bulk SMS in Pune
ReplyDeleteNice
ReplyDeleteReally useful guide, thanks.
ReplyDeleteI get stuck on step 5 - the Add button is greyed out on my console. Can anyone please suggest why?
Have you checked to make sure that you are adding it to the Default Client Settings? You certainly don't have to enable it on the default, but it has to be added there...
DeleteI'm trying to collect data from a class that already exists: Win32_OfflineFilesCache. Unfortunately the inventoryagent.log file indicates errors when trying to process this class. It's a singleton class that has one instance. Not sure whether SCCM 2012 is issuing a proper query.
ReplyDeleteThanks for sharing this great stuff.
ReplyDeleteOnline Accounting Software
Your site works the same manner on VPS Malaysia | For All Hosting Needs | Contact Us.
ReplyDeleteI've used this article before, and I'm using it again. This is probably the best "How To" I've seen so far for collecting specific registry entries into the Hardware Inventory.
ReplyDeleteMS SCCM 2012 Online Training
ReplyDeleteTry solo ads. Solo ads are ones that you provide to owners of e-mail newsletters. Learn more about NI Marine | on this site.
ReplyDeletetry this
ReplyDeleteB Best Hair Oil
kunkumadi face Oil
Wheat Grass Powder
Balu Herbals
UB-Slim caps
B-Care Dia Powder
Noni
thanks for sharing
ReplyDeleteCustomized Inventory Software
It Evangelist: Sccm 2012 – Customize / Extend Hardware Inventory >>>>> Download Now
ReplyDelete>>>>> Download Full
It Evangelist: Sccm 2012 – Customize / Extend Hardware Inventory >>>>> Download LINK
>>>>> Download Now
It Evangelist: Sccm 2012 – Customize / Extend Hardware Inventory >>>>> Download Full
>>>>> Download LINK
kırşehir
ReplyDeletekırıkkale
manisa
tokat
urfa
UA0M2
yurtdışı kargo
ReplyDeleteresimli magnet
instagram takipçi satın al
yurtdışı kargo
sms onay
dijital kartvizit
dijital kartvizit
https://nobetci-eczane.org/
JKFM
Adana
ReplyDeleteErzurum
Sinop
istanbul
Düzce
54X
bartın evden eve nakliyat
ReplyDeletebitlis evden eve nakliyat
diyarbakır evden eve nakliyat
kars evden eve nakliyat
nevşehir evden eve nakliyat
PVH07L
sakarya evden eve nakliyat
ReplyDeleteosmaniye evden eve nakliyat
aksaray evden eve nakliyat
çanakkale evden eve nakliyat
zonguldak evden eve nakliyat
YK437
رش مبيدات
ReplyDelete52D90
ReplyDeleteGiresun Lojistik
Hotbit Güvenilir mi
Batman Lojistik
Gümüşhane Lojistik
Ünye Evden Eve Nakliyat
Urfa Lojistik
Yalova Lojistik
Yozgat Şehirler Arası Nakliyat
Diyarbakır Parça Eşya Taşıma
شركة تسليك مجاري بالدمام wgYgUlC2hy
ReplyDelete