How to Use RegKeyToMof
***updated June 27 2016 new link for RegKeytoMOF ***
By Garth Jones
RegKeyToMof is a useful tool for any Configuration Manager (CM) administrator. This tool allows you to inventory registry keys on a PC and return the data back to CM. At this point you can do whatever you want to the data – create reports, create collections, etc.
I recently received an email from a client asking to help them with this 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.”
My hope is to put a definitive guide together in this blog post.
I will only show step-by-step instructions for System Center 2012 Configuration Manager (CM12), but if you are using CM07 you can follow these steps by using the Configuration Manager tab and the sms_def.mof tab and files.
I also recommend that you back-up your configuration.mof file (CM12 and CM07) and your sms_def.mof file (CM07).
With CM12, I will assume that:
· You are looking for static keys under: HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Terminal Server\RCM
· You already downloaded RegKeyToMof from: http://mnscug.org/images/Sherry/RegKeyToMOFv33a.zip
First, browse to the registry key in the upper left window.
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 example you can see that I changed ClassGroup from “Custom” to “Enhansoft” and ClassName from “RCM” to “ES_RCM”.
You will notice that as you make changes in the various text boxes, the configuration.mof text will also change. Really, that’s all there is to the 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.
Now, let’s start with appending the text to the configuration.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 CM07 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 CM12 console, and click Set Classes…
Click the Import… button.
Select the RCM.mof file and click the Open button.
Click on the Import button.
Notice that the two classes are now imported and click OK.
Lastly, wait for clients to start reporting inventory. This will take up to twice the usual hardware inventory cycle before the newly inventoried regkeys will show up.