Re: Help with extending MOF to add Registry info - SMS 2003



Nevermind...the MOF in my previous post is working, but I was making a
mistake when testing with WBEMTEST.


Victag wrote:
Made a bunch mroe changes..and the MOF is compiling without error, but
when I use WMEBTEST and open the instances, the values are NULL? Here
is what I have got so far:

// Adding WinLogon
//=====================================================================
//=====================================================================
// Phase 1 Defined: Registering the System Registry Provider
//=====================================================================
#pragma namespace("\\\\.\\root\\cimv2")
instance of __Win32Provider as $PropProv3
{
Name ="RegPropProv" ;
ClsID = "{72967901-68EC-11d0-B729-00AA0062CBB7}";
};
instance of __PropertyProviderRegistration
{
Provider = $PropProv3;
SupportsPut = TRUE;
SupportsGet = TRUE;
};
//=====================================================================
// Phase 2 Defined: Defining a Registry Class With Qualifiers
//=====================================================================
#pragma deleteclass("WinLogon", NOFAIL)
[DYNPROPS]
class WinLogon
{
[key]string Keyname="";
string DefaultUserName;
};
[DYNPROPS]
instance of WinLogon
{
KeyName="WinLogon";

[PropertyContext("local|HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows
NT\\CurrentVersion\\WinLogon|DefaultUserName"),
Dynamic, Provider("RegPropProv")] DefaultUserName;
};
//=====================================================================
//Phase 3 Defined: Reporting Inventory for a New Hardware Class
//=====================================================================
#pragma namespace("\\\\.\\root\\cimv2\\sms")
[SMS_Report(TRUE),
SMS_Group_Name("WinLogon"),
SMS_Class_ID("MICROSOFT|WinLogon|1.0")]
class WinLogon : SMS_Class_Template
{
[SMS_Report(TRUE),key]
string KeyName;
[SMS_Report(TRUE)]
string DefaultUserName;

};

Victag wrote:
I have changed my MOF to what is below, and am now getting the error
"Error occurred while processing item 3 lines 51-59...Class has
instances".

I am stumped! Here is what I am using:

// Adding LastRealUser

//=====================================================================



//=====================================================================

// Phase 1 Defined: Registering the System Registry Provider

//=====================================================================



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

instance of __Win32Provider as $PropProv3

{

Name ="RegPropProv" ;

ClsID = "{72967901-68EC-11d0-B729-00AA0062CBB7}";

};

instance of __PropertyProviderRegistration

{

Provider = $PropProv3;

SupportsPut = TRUE;

SupportsGet = TRUE;

};



//=====================================================================

// Phase 2 Defined: Defining a Registry Class With Qualifiers

//=====================================================================



[DYNPROPS]

class LastRealUser

{

[key]string LastUserName;



};



[DYNPROPS]

instance of LastRealUser

{




[PropertyContext("local|HKEY_LOCAL_MACHINE\\System\\CurrentControlSet\\Control\\WinLogon|DefaultUserName"),

Dynamic, Provider("RegPropProv")] LastUserName;



};



//=====================================================================

//Phase 3 Defined: Reporting Inventory for a New Hardware Class

//=====================================================================



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



[SMS_Report(TRUE),

SMS_Group_Name("LastRealUser"),

SMS_Class_ID("MICROSOFT|LastRealUser|1.0")]

class LastRealUser : SMS_Class_Template

{



[SMS_Report(TRUE)]

string LastUserName;



};


­-----------------------------------------

.



Relevant Pages