Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

SMS_DEF.MOF and null registry values

7 views
Skip to first unread message

AndyD

unread,
Dec 17, 2009, 4:59:45 AM12/17/09
to
I've been trying to report on registry values using SMS_DEF.mof and
have failed!

SMS2003 SP2 and I'm trying to pull 3 registry values back from each
machine, custom entries all of them.

WBEMTEST shows that WMI is creating the entries but they're always
NULL as if the registry is not actually being read.

My chunk of code is as follows, (and yes Sherry you may recognise it -
it's something you helped me put together ages ago that got stopped as
being unimportant at the time but has now been asked for again!)

#pragma namespace("\\\\.\\root\\cimv2")
#pragma deleteclass("GBITS_Info", NOFAIL)

//Class info - don't use numeric chars
[DYNPROPS]
class GBITS_Info
{
[key] string KeyName="";
string PatchWithSMS;
string GBITSService;
string BuildInfo;
};
// Instance info - don't use numeric chars
[DYNPROPS]
instance of GBITS_Info
{
[PropertyContext("local|HKEY_LOCAL_MACHINE\\Software\\3i|
PatchWithSMS"),
Dynamic, Provider("RegPropProv")] PatchWithSMS;
[PropertyContext("local|HKEY_LOCAL_MACHINE\\Software\\3i|
GBITSService"),
Dynamic, Provider("RegPropProv")] GBITSService;
[PropertyContext("Local|HKEY_LOCAL_MACHINE\\Software\\Microsoft\
\Windows NT\\CurrentVersion|3iBuildInfo"),
Dynamic, Provider("RegPropProv")] BuildInfo;

};

// Reporting Class info
#pragma namespace("\\\\.\\root\\cimv2\\SMS")
#pragma deleteclass("GBITS_Info", NOFAIL)
[SMS_Report(TRUE), SMS_Group_Name("3i Info"),SMS_Class_ID
("GBITS_Info")]
class GBITS_Info : SMS_Class_Template
{
[SMS_Report(TRUE) ] string PatchWithSMS;
[SMS_Report(TRUE) ] string GBITSService;
[SMS_Report(TRUE) ] string BuildInfo;
};

Sherry Kissinger [MVP]

unread,
Dec 17, 2009, 8:36:02 PM12/17/09
to
I'm thinking your missing the keyname in 2 spots. Watch for word wrap in the
below; clean it up--it's probably wrapped badly.

Another thought: are those regkeys really strings? reg_sz?

Last but not least, if you haven't discovered it yet, you might want to grab
a copy of Mark Cochrane's RegKeytoMof utility. You're grabbing from two diff
areas in the registry, but it still might be helpful to you to get structure,
and then you could append it together.

#pragma namespace("\\\\.\\root\\cimv2")
#pragma deleteclass("GBITS_Info", NOFAIL)

//Class info - don't use numeric chars
[DYNPROPS]
class GBITS_Info
{
[key] string KeyName="";
string PatchWithSMS;
string GBITSService;
string BuildInfo;
};
// Instance info - don't use numeric chars
[DYNPROPS]
instance of GBITS_Info
{

Keyname="gbitskey";


[PropertyContext("local|HKEY_LOCAL_MACHINE\\Software\\3i|
PatchWithSMS"),
Dynamic, Provider("RegPropProv")] PatchWithSMS;
[PropertyContext("local|HKEY_LOCAL_MACHINE\\Software\\3i|
GBITSService"),
Dynamic, Provider("RegPropProv")] GBITSService;
[PropertyContext("Local|HKEY_LOCAL_MACHINE\\Software\\Microsoft\
\Windows NT\\CurrentVersion|3iBuildInfo"),
Dynamic, Provider("RegPropProv")] BuildInfo;

};

// Reporting Class info
#pragma namespace("\\\\.\\root\\cimv2\\SMS")
#pragma deleteclass("GBITS_Info", NOFAIL)
[SMS_Report(TRUE), SMS_Group_Name("3i Info"),SMS_Class_ID
("GBITS_Info")]
class GBITS_Info : SMS_Class_Template
{

[SMS_Report(TRUE),Key ] string Keyname;


[SMS_Report(TRUE) ] string PatchWithSMS;
[SMS_Report(TRUE) ] string GBITSService;
[SMS_Report(TRUE) ] string BuildInfo;
};

"AndyD" wrote:

> .
>

AndyD

unread,
Dec 23, 2009, 11:04:47 AM12/23/09
to
On Dec 18, 1:36 am, Sherry Kissinger [MVP]

Cheers - all tested and working now

0 new messages