Share via


create collection based on registry key

Question

Thursday, April 24, 2014 5:41 PM

We are running Configuration Manager 2012 R2 in Single Primary Site mode.

We need to create collection based on All Servers that contain following registry key:

HKLM-Software-Neuberger-Management

Maintenance Window REG_SG Wave X

All replies (12)

Sunday, April 27, 2014 1:46 AM âś…Answered | 1 vote

I would use the Wizard to create the collection, this way you don't have to worry about syntax as much.

Your query above looks ok, it will give you all PCs with the key RegKeyToMof_64. Why do you think it is not right?

http://www.enhansoft.com/

The key shouldn't be "RegKeyToMof_64" though.

John Marcum | http://myitforum.com/myitforumwp/author/johnmarcum/


Thursday, April 24, 2014 5:54 PM

Use reg-key-to-mof, it's a free utlity. Then collect the key in HINV.

John Marcum | http://myitforum.com/myitforumwp/author/johnmarcum/


Thursday, April 24, 2014 7:26 PM

Alternative: use compliance settings. Create a CI that checks the existence of that reg key. Create a collection of all compliant systems.

Torsten Meringer | http://www.mssccmfaq.de


Thursday, April 24, 2014 7:29 PM

I got the 3.1 utility and ran on the server.

There are two sections in the tool

Configuration.mof
to import in Admin/AgentSettings/HardwareInventory/SetClasses/Import

Which one goes where?

Do I need modify the sms_def.mof or configuration.mof or both?


Thursday, April 24, 2014 9:49 PM

Do we modify SMS_def.mof or Configuration.mof for Configuration Manager 2012 R2?


Thursday, April 24, 2014 10:16 PM

We would like to create collection based on registry key (HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Neuberger\Management|Maintenance Window)

Used RegKeyToMOFv31 to create the program to extend hardware inventory.

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

#pragma deleteclass("Management", NOFAIL)

[DYNPROPS]

Class Management

{

[key] string KeyName;

String MaintenanceWindow;

};

[DYNPROPS]

Instance of Management

{

KeyName="RegKeyToMOF_32";

[PropertyContext("Local|HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Neuberger\Management|Maintenance Window"),Dynamic,Provider("RegPropProv")] MaintenanceWindow;

};

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

#pragma deleteclass("Management_64", NOFAIL)

[DYNPROPS]

Class Management_64

{

[key] string KeyName;

String MaintenanceWindow;

};

[DYNPROPS]

Instance of Management_64

{

KeyName="RegKeyToMOF_64";

[PropertyContext("Local|HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Neuberger\Management|Maintenance Window"),Dynamic,Provider("RegPropProv")] MaintenanceWindow;

};

Do we append the program to Configuration.mof file and test the inventory results


Thursday, April 24, 2014 11:11 PM | 1 vote

In 2012 there's no longer an editable def.mof so you save that one as whatever.mof and import it into your client agent settings. Then you add the stuff from the configuration.mof tab to the configuration.mof file.

John Marcum | http://myitforum.com/myitforumwp/author/johnmarcum/


Friday, April 25, 2014 1:34 AM | 1 vote

I did up a blog post on how to use it with CM12.

http://be.enhansoft.com/post/2014/02/13/How-to-Use-RegKeyToMof.aspx

http://www.enhansoft.com/


Saturday, April 26, 2014 2:09 PM

That's a great blog.  

I followed your steps for HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Terminal Server\RCM

1. Appended the text within the configuration.mof

2. Imported RCM.MOF

3. Newly inventoried regkeys show up in resource explorer.

What will be the syntax for collection containing that registry key?

I tried with following but doesn't seem to be correct.

select *  from  SMS_R_System inner join SMS_G_System_THG_RCM64 on SMS_G_System_THG_RCM64.ResourceId = SMS_R_System.ResourceId where SMS_G_System_THG_RCM64.KeyName = "RegKeyToMOF_64"

Please advise.


Saturday, April 26, 2014 4:10 PM | 1 vote

I would use the Wizard to create the collection, this way you don't have to worry about syntax as much.

Your query above looks ok, it will give you all PCs with the key RegKeyToMof_64. Why do you think it is not right?

http://www.enhansoft.com/


Saturday, April 26, 2014 4:28 PM

I will test the same in customer environment on Monday. Thanks for your help.


Tuesday, April 29, 2014 11:08 PM

Yeah it worked in customer environment. We are able to query the registry keys. Thanks all.