Several years ago I received an email from a client asking for help with the RegKeyToMof tool. They asked, “Do you know the process for using RegKeyToMof.exe and how to append the configuration.mof and/or importing MOFs? This might be a tremendous help because I haven’t seen a definitive guide.” This question is still one that I hear, so I thought that I would update my original blog post and show you how to use RegKeyToMof.
What is RegKeyToMof?
RegKeyToMof is a useful tool for any System Center Configuration Manager (SCCM) administrator. This tool allows you to inventory registry keys on a PC and return the data back to SCCM. From this point you can then do whatever you want to the data: create reports, create collections, etc.
How to Use RegKeyToMof
The following step-by-step instructions are from my original post and are for System Center 2012 Configuration Manager, but whether you are using Current Branch or SCCM 2007, you can still follow these instructions. For SCCM 2007 make sure to use the Configuration Manager tab and the sms_def.mof tab and files.
For all versions of SCCM, I also recommend that you back-up your configuration.mof file (Current Branch, 2012 and 2007) and your sms_def.mof file (2007 only).
I will assume that:
-You are looking for static keys under:
-You already downloaded RegKeyToMof from the TechNet.
Next, change the ClassGroup and ClassName. This is an optional step, but I recommend doing this so that you can ensure that the mof edit is unique. In the examples above and below you can see that I changed ClassGroup from Custom to Enhansoft and ClassName from RCM to ES_RCM.
As you make changes in the various text boxes you’ll see that the configuration.mof text will also change. Really, that’s all that there is to this tool. It creates the mof edits that you require and now all you have to do is append/import these edits to the appropriate files.
Appending Text to the Mof File
Open your configuration.mof file located here, <CM install directory>\inboxes\clifiles.src\hinv, and scroll to the bottom of the configuration.mof file. Next, append all of the text within the configuration.mof tab in RegKeyToMof.
Note: For SCCM 2007 repeat the above process with the sms_def.mof tab and file. Once you have done that, you are done.
Copy the agent setting mof text from the, to import in Admin/…, tab into a text file. I have called the one in my example, RCM.mof.
Go to the Client Agent setting section in the SCCM Current Branch or 2012 console, and click Set Classes…
Click on the Import… button.
Select the RCM.mof file and then click on the Open button.
Notice that the two classes are imported and then click OK.
Lastly, wait for the clients to start reporting inventory. This will take up to twice the usual hardware inventory cycle before the newly inventoried regkeys show up.
If you have any questions, please feel free to contact me @GarthMJ.
Do you have an idea for a blog post about a SCCM query or reporting topic? Let me know. Your idea might become the focus of my next blog post!