Go Back   PackageDeploy Application Packaging Forums > Package Development > Application Deployment > Microsoft SMS 2003

Reply
 
LinkBack Thread Tools Display Modes
Old 03-15-2010, 06:55 PM   #1 (permalink)
AndyD
Guest
 
Posts: n/a
Default SMS_DEF.MOF and null registry values

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\\Softwar e\\3i|
PatchWithSMS"),
Dynamic, Provider("RegPropProv")] PatchWithSMS;
[PropertyContext("local|HKEY_LOCAL_MACHINE\\Softwar e\\3i|
GBITSService"),
Dynamic, Provider("RegPropProv")] GBITSService;
[PropertyContext("Local|HKEY_LOCAL_MACHINE\\Softwar e\\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;
};
  Reply With Quote
Old 03-15-2010, 06:55 PM   #2 (permalink)
AndyD
Guest
 
Posts: n/a
Default Re: SMS_DEF.MOF and null registry values

On Dec 18, 1:36*am, Sherry Kissinger [MVP]
<SherryKissinger...@discussions.microsoft.com> wrote:
> 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\\Softwar e\\3i|
> PatchWithSMS"),
> * *Dynamic, Provider("RegPropProv")] PatchWithSMS;
> * [PropertyContext("local|HKEY_LOCAL_MACHINE\\Softwar e\\3i|
> GBITSService"),
> * *Dynamic, Provider("RegPropProv")] GBITSService;
> * [PropertyContext("Local|HKEY_LOCAL_MACHINE\\Softwar e\\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:
> > 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\\Softwar e\\3i|
> > PatchWithSMS"),
> > * *Dynamic, Provider("RegPropProv")] PatchWithSMS;
> > * [PropertyContext("local|HKEY_LOCAL_MACHINE\\Softwar e\\3i|
> > GBITSService"),
> > * *Dynamic, Provider("RegPropProv")] GBITSService;
> > * [PropertyContext("Local|HKEY_LOCAL_MACHINE\\Softwar e\\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;
> > * *};
> > .


Cheers - all tested and working now
  Reply With Quote
Old 03-15-2010, 06:55 PM   #3 (permalink)
Sherry Kissinger [MVP]
Guest
 
Posts: n/a
Default RE: SMS_DEF.MOF and null registry values

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\\Softwar e\\3i|
PatchWithSMS"),
Dynamic, Provider("RegPropProv")] PatchWithSMS;
[PropertyContext("local|HKEY_LOCAL_MACHINE\\Softwar e\\3i|
GBITSService"),
Dynamic, Provider("RegPropProv")] GBITSService;
[PropertyContext("Local|HKEY_LOCAL_MACHINE\\Softwar e\\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:

> 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\\Softwar e\\3i|
> PatchWithSMS"),
> Dynamic, Provider("RegPropProv")] PatchWithSMS;
> [PropertyContext("local|HKEY_LOCAL_MACHINE\\Softwar e\\3i|
> GBITSService"),
> Dynamic, Provider("RegPropProv")] GBITSService;
> [PropertyContext("Local|HKEY_LOCAL_MACHINE\\Softwar e\\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;
> };
> .
>

  Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 09:07 PM.


vBulletin, Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
2007 - 2012 PackageDeploy.com