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;
};
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:
> .
>
Cheers - all tested and working now