myITforum.com Community Forum myITforum.com Community Forum

Home  Forums  Blogs  Live Support chat  Search Articles  Wiki  FAQ  Email Lists  Register  Login  My Profile  Inbox  Address Book  My Subscription  My Forums 

Photo Gallery  Member List  Search  Calendars  FAQ  Ticket List  Log Out

All Forums RSS Feed Subscription:


           



MOF changes

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
  Printable Version
All Forums >> [Management Products] >> Microsoft Systems Management Server >> SMS 2003 >> MOF changes Page: [1]
Login
Message << Older Topic   Newer Topic >>
MOF changes - 5/5/2008 3:43:35 PM   
lbriggs


Posts: 91
Score: 2
Joined: 7/10/2003
From: Hartford, CT
Status: offline
I'm creating a mini mof file to query a particule set of registry keys pertaining to the builds in our environment.  The data is currently stored in the location HKLM\SOFTWARE\MyCompany\Build\Config\NAMEOFBUILD\

The data stored under the NAMEOFBUILD subkey is a bunch of values pertaining to the software in that build.  I'm not interested in that, only the name of the subkey 'NAMEOFBUILD'.  I have the following MOF file written, but it doesn't appear to be doing anything:

//----------------------
// Build Information
//----------------------
#pragma namespace ("\\\\.\\root\\cimv2")
#pragma deleteclass ("win32Reg_Build",NOFAIL)
[ dynamic,
 provider("RegProv"),
 ClassContext("local|HKEY_LOCAL_MACHINE\\SOFTWARE\\MyCompany\\Build\\CONFIG")
]
class Win32Reg_Build
{
   [key]                               string    ScheduledJobs;
};
#pragma namespace ("\\\\.\\root\\cimv2\\sms")
#pragma deleteclass ("win32Reg_Build",NOFAIL)
[ SMS_Report     (TRUE),
 SMS_Group_Name ("Build Info"),
 SMS_Class_ID   ("MICROSOFT|BUILD_INFO|1.0") ]
class Win32Reg_Build : SMS_Class_Template
{
   [SMS_Report (TRUE), key ] string ScheduledJobs;
};
//----------------------
// Build Information
//----------------------


After compiling locally with mofcomp, I inspect the class and have a null value for ScheduledJobs.  Am I missing something here?  Or is it not possible to query on just the subkey without asking for values under it.

*looks around for SKissinger*
Post #: 1
RE: MOF changes - 5/5/2008 5:47:29 PM   
skissinger


Posts: 1676
Score: 103
Joined: 9/13/2001
From: Sherry Kissinger
Status: offline
Not really sure what you mean by 'inspect the class'.  If you mean you used wbemtest and looked at what might be stored in root\cimv2\sms\win32reg_build; yes... that'll be empty.  It's just a placeholder.

Without seeing your .reg, I'd maybe change it to:

quote:

//----------------------
// Build Information
//----------------------
#pragma namespace ("\\\\.\\root\\cimv2")
#pragma deleteclass ("win32Reg_Build",NOFAIL)
[DYNPROPS]
class win32Reg_Build
{
   [key]  string    KeyName;
   string   ScheduledJobs;
};
[DYNPROPS]
instance of win32Reg_Build
{
KeyName = "Build";
[PropertyContext("local|HKEY_LOCAL_MACHINE\\Software\\MyCompany\\Build\\Config|ScheduledJobs"),
Dynamic,Provider("RegPropProv")] ScheduledJobs;
};
#pragma namespace ("\\\\.\\root\\cimv2\\sms")
#pragma deleteclass ("win32Reg_Build",NOFAIL)
[ SMS_Report     (TRUE),
SMS_Group_Name ("Build Info"),
SMS_Class_ID   ("MICROSOFT|BUILD_INFO|1.0") ]
class Win32Reg_Build : SMS_Class_Template
{
  [SMS_Report (TRUE), key ] string KeyName;
  [SMS_Report (TRUE) ] string ScheduledJobs;
};



But test test test.  It's just a thought; and again I don't know what your regkey really looks like...

_____________________________

mofmaster@smsexpert.com (version 2007) | http://www.smsexpert.com | http://www.sccmexpert.com
Microsoft MVP - SMS

Inventory Manager 2007 is here!

(in reply to lbriggs)
Post #: 2
RE: MOF changes - 5/5/2008 10:17:36 PM   
lbriggs


Posts: 91
Score: 2
Joined: 7/10/2003
From: Hartford, CT
Status: offline
Thanks for the tip.  I'll try it again in the morning, along with a sample regkey for clarification.

And yes, by 'inspect the class' I was using wbemtest.  If that is always empty, how can I verify that everything is working and actually view the data in WMI?

(in reply to skissinger)
Post #: 3
RE: MOF changes - 5/6/2008 7:20:52 AM   
lbriggs


Posts: 91
Score: 2
Joined: 7/10/2003
From: Hartford, CT
Status: offline
RegKey example:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\HIG\Build\CONFIG]

[HKEY_LOCAL_MACHINE\SOFTWARE\HIG\Build\CONFIG\XPSP2-HIG Core]
"EnCase Servlet"="Scheduled by  on 12-04-07 @ 16:06:11"
"Altiris NS Client 6 SP3 R5"="Scheduled by  on 12-04-07 @ 16:06:11"
"Microsoft SMS 2003 SP3 Client"="Scheduled by  on 12-04-07 @ 16:06:11"
"SU Service"="Scheduled by  on 12-04-07 @ 16:06:11"
"Microsoft Visio Viewer 2003"="Scheduled by  on 12-04-07 @ 16:06:11"
"Adobe Acrobat Reader 7.0.5"="Scheduled by  on 12-04-07 @ 16:06:11"
"Placeholder"="Scheduled by  on 12-04-07 @ 16:06:11"
"Lotus Sametime 6.5FP1"="Scheduled by  on 12-04-07 @ 16:06:11"
"Macromedia Authorware Plugin 7"="Scheduled by  on 12-04-07 @ 16:06:11"
"Adobe Flash Player 9.0"="Scheduled by  on 12-04-07 @ 16:06:11"
"Macromedia Shockwave Plugin 10"="Scheduled by  on 12-04-07 @ 16:06:11"
"XStream Software RapidPlayer 3"="Scheduled by  on 12-04-07 @ 16:06:11"
"Citrix Web Client 9.1"="Scheduled by  on 12-04-07 @ 16:06:11"
"HIG System Information Tool 1.0.0"="Scheduled by  on 12-04-07 @ 16:06:11"
"Microsoft Compatibility Pack For Office 2007"="Scheduled by  on 12-04-07 @ 16:06:11"
"Altiris Application Metering 6.1.31"="Scheduled by  on 12-04-07 @ 16:06:11"
"Opnet Capture Agent 3.1"="Scheduled by  on 12-04-07 @ 16:06:11"
"Symantec AntivirusClient 10"="Scheduled by  on 12-04-07 @ 16:06:11"


(in reply to lbriggs)
Post #: 4
RE: MOF changes - 5/6/2008 8:08:40 AM   
skissinger


Posts: 1676
Score: 103
Joined: 9/13/2001
From: Sherry Kissinger
Status: offline
Hmm... I can't think of a way to dynamically grab that data.  It looks like the keynames are unique for each entry: "Lotus Sametime 6.5Fp1", etc.  You'd have to code each key into your MOF, and then update your mof every time you add another one.  I suspect it is way too late to change your registry branding... but the mof would need keynames that don't change, perhaps something like this; then it could be modeled after the add/remove programs snippet:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\HIG\Build\CONFIG]

[HKEY_LOCAL_MACHINE\SOFTWARE\HIG\Build\CONFIG\XPSP2-HIG Core]

 
[HKEY_LOCAL_MACHINE\SOFTWARE\HIG\Build\CONFIG\XPSP2-HIG Core\EnCaseServLet]

"TAG"="Scheduled by  on 12-04-07 @ 16:06:11"
 
[HKEY_LOCAL_MACHINE\SOFTWARE\HIG\Build\CONFIG\XPSP2-HIG Core\Altiris NS Client 6 SP3 R5]

"TAG"="Scheduled by  on 12-04-07 @ 16:06:11"



_____________________________

mofmaster@smsexpert.com (version 2007) | http://www.smsexpert.com | http://www.sccmexpert.com
Microsoft MVP - SMS

Inventory Manager 2007 is here!

(in reply to lbriggs)
Post #: 5
RE: MOF changes - 5/6/2008 10:05:52 AM   
lbriggs


Posts: 91
Score: 2
Joined: 7/10/2003
From: Hartford, CT
Status: offline
So there is no way to grab just the keyname, in this example 'XPSP2-HIG Core' ?  That's all I'm after.

(in reply to skissinger)
Post #: 6
RE: MOF changes - 5/6/2008 8:45:27 PM   
skissinger


Posts: 1676
Score: 103
Joined: 9/13/2001
From: Sherry Kissinger
Status: offline
If all you want is the name of the subkey under CONFIG, whatever that may be, yes.  I'd model it after the Add/remove Programs sample, where it's pulling in the subkey name under \uninstall

_____________________________

mofmaster@smsexpert.com (version 2007) | http://www.smsexpert.com | http://www.sccmexpert.com
Microsoft MVP - SMS

Inventory Manager 2007 is here!

(in reply to lbriggs)
Post #: 7
Page:   [1]
All Forums >> [Management Products] >> Microsoft Systems Management Server >> SMS 2003 >> MOF changes Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI

0.328