Re: Hardware Inventory of registry SMS 2003 sms_def.mof Help!

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Joseph Calabig [MSFT] (jcalabig_at_microsoft.com)
Date: 06/18/04


Date: Fri, 18 Jun 2004 12:06:24 -0700

BTW,
here's the link for deleteclass:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/pragma_deleteinstance.asp

-- 
Thanks,
Joseph Calabig
This posting is provided "AS IS" with no warranties, and confers no rights.
"Joseph Calabig [MSFT]" <jcalabig@microsoft.com> wrote in message 
news:O%23XiPAWVEHA.3428@TK2MSFTNGP12.phx.gbl...
> We're back to the original problem where WMI complains about existing 
> records while changing the definition for that class.
> You can also delete those instances by doing something like this:
>
> mof start ---------------
> #pragma namespace ("\\\\.\\root\\cimv2")
> #pragma deleteclass ("CCCImageDetails", nofail)
> mof end ---------------
>
> Save these lines to a file and Mofcomp it on your machines where you're 
> getting this failure. You might have to advertise this to you clients if 
> you already have deployed it.
>
> Easiest way is to introduce this class definition under a new name, that 
> way you won't clash with your previously instantiated class.
>
> -- 
> Thanks,
> Joseph Calabig
>
> This posting is provided "AS IS" with no warranties, and confers no 
> rights.
>
> "Steve Adams" <steven.adams@nospam.com> wrote in message 
> news:OmCV4hNVEHA.1164@tk2msftngp13.phx.gbl...
>> (Fri Jun 18 12:54:01 2004.10473000) : Parsing MOF file:
>> F:\SMS\inboxes\clifiles.src\hinv\sms_def.mof
>> (Fri Jun 18 12:54:02 2004.10473593) : An error occurred while processing
>> item 102 defined on lines 4646 - 4657 in file
>> F:\SMS\inboxes\clifiles.src\hinv\sms_def.mof:
>> (Fri Jun 18 12:54:02 2004.10473593) : Error Number: 0x80041026, Facility:
>> WMI
>> Description: Class has instances
>>
>> The registry details I'm trying to gather are:
>>
>> Windows Registry Editor Version 5.00
>>
>> [HKEY_LOCAL_MACHINE\SOFTWARE\CCCImageDetails]
>> "Build Date"="8/06/2004"
>> "Build Type"="CCCSTD"
>> "Build Version"="1.1.165"
>> "Imaged Date"="10/06/2004"
>> "Domain"="CCITY"
>> "AddStatus"="Complete"
>> "JoinTime"="10/06/2004 11:24:45 a.m."
>> "JoinVersion"="3.00 03-May-2004"
>>
>>
>> Hope that helps.
>>
>>
>>
>>
>> "Joseph Calabig [MSFT]" <jcalabig@microsoft.com> wrote in message
>> news:e8gA6UNVEHA.212@TK2MSFTNGP12.phx.gbl...
>>> See if you can view the specific error/s in the wbem logs. You can see
>> them
>>> in %windir%\system32\wbem\logs\mofcomp.log
>>> Let me know what you see.
>>> -- 
>>> Thanks,
>>> Joseph Calabig
>>>
>>> This posting is provided "AS IS" with no warranties, and confers no
>> rights.
>>>
>>> "Steve Adams" <steven.adams@nospam.com> wrote in message
>>> news:ecXnbDNVEHA.2972@TK2MSFTNGP11.phx.gbl...
>>> > Thanks,
>>> >
>>> > That error message has gone away.
>>> >
>>> > I modified the sms_def.mof by adding the following to the end of the
>> file:
>>> >
>>> >
>>> > //=====================================================================
>>> > // Christchurch City Council
>>> > // S. Adams
>>> > // 17-June-2004
>>> > //
>>> > // Workstation Build and Image details
>>> > // USed for Windows XP Workstation
>>> > // Build and Image Registry Keys
>>> > //=====================================================================
>>> >
>>> > #pragma namespace ("\\\\.\\root\\cimv2")
>>> >
>>> > [DYNPROPS]
>>> > class CCCImageDetails
>>> > {
>>> >    [key]string Keyname="";
>>> >     string BuildDate;
>>> >     string BuildType;
>>> >     string BuildVersion;
>>> >     string ImagedDate;
>>> >     string Domain;
>>> >     string AddStatus;
>>> >     string JoinTime;
>>> >     string JoinVersion;
>>> > };
>>> >
>>> > [DYNPROPS]
>>> > instance of CCCImageDetails
>>> > {
>>> >    KeyName = "CCCImageDetails";
>>> >
>>> >
>> [PropertyContext("local|HKEY_LOCAL_MACHINE\\SOFTWARE\\CCCImageDetails|Build
>>> > Date"),
>>> >          Dynamic, Provider("RegPropProv")] BuildDate;
>>> >
>>> >
>> [PropertyContext("local|HKEY_LOCAL_MACHINE\\SOFTWARE\\CCCImageDetails|Build
>>> > Type"),
>>> >          Dynamic, Provider("RegPropProv")] BuildType;
>>> >
>>> >
>> [PropertyContext("local|HKEY_LOCAL_MACHINE\\SOFTWARE\\CCCImageDetails|Build
>>> > Version"),
>>> >          Dynamic, Provider("RegPropProv")] BuildVersion;
>>> >
>>> >
>> [PropertyContext("local|HKEY_LOCAL_MACHINE\\SOFTWARE\\CCCImageDetails|Imaged
>>> > Date"),
>>> >          Dynamic, Provider("RegPropProv")] ImagedDate;
>>> >
>>> >
>> [PropertyContext("local|HKEY_LOCAL_MACHINE\\SOFTWARE\\CCCImageDetails|Domain
>>> > "),
>>> >          Dynamic, Provider("RegPropProv")] Domain;
>>> >
>>> >
>> [PropertyContext("local|HKEY_LOCAL_MACHINE\\SOFTWARE\\CCCImageDetails|AddSta
>>> > tus"),
>>> >          Dynamic, Provider("RegPropProv")] AddStatus;
>>> >
>>> >
>> [PropertyContext("local|HKEY_LOCAL_MACHINE\\SOFTWARE\\CCCImageDetails|JoinTi
>>> > me"),
>>> >          Dynamic, Provider("RegPropProv")] JoinTime;
>>> >
>>> >
>> [PropertyContext("local|HKEY_LOCAL_MACHINE\\SOFTWARE\\CCCImageDetails|JoinVe
>>> > rsion"),
>>> >          Dynamic, Provider("RegPropProv")] JoinVersion;
>>> > };
>>> >
>>> >
>>> > #pragma namespace ("\\\\.\\root\\cimv2\\sms")
>>> >
>>> > [ SMS_Report (TRUE),
>>> >  SMS_Group_Name ("CCCImageDetails"),
>>> >  SMS_Class_ID ("CHRISTCHURCH_CITY_COUNCIL|CCCImageDetails|1.0") ]
>>> >
>>> > class CCCImageDetails : SMS_Class_Template
>>> > {
>>> >
>>> >     [SMS_Report(TRUE)]
>>> >      string BuildDate;
>>> >     [SMS_Report(TRUE)]
>>> >      string BuildType;
>>> >     [SMS_Report(TRUE)]
>>> >      string BuildVersion;
>>> >     [SMS_Report(TRUE)]
>>> >      string ImagedDate;
>>> >     [SMS_Report(TRUE)]
>>> >      string Domain;
>>> >     [SMS_Report(TRUE)]
>>> >      string AddStatus;
>>> >     [SMS_Report(TRUE)]
>>> >      string JoinTime;
>>> >     [SMS_Report(TRUE)]
>>> >      string JoinVersion;
>>> >    [SMS_Report (TRUE), key ]
>>> >        string KeyName;
>>> > };
>>> >
>>> >
>>> > Mof Compiler failed
>>> > error occured whiole storing the data
>>> > The mof file is backed up as bad and the previous version is restored.
>>> >
>>> > Any ideas ?
>>> >
>>> > Thanks,
>>> >
>>> > /Steve
>>> > "Joseph Calabig [MSFT]" <jcalabig@microsoft.com> wrote in message
>>> > news:uqHFv4LVEHA.2544@TK2MSFTNGP10.phx.gbl...
>>> >> WMI complained that you're editng a class definition while it has
>>> > instances.
>>> >> You should first delete these classes through wbemtest.exe then do 
>>> >> your
>>> >> mofcomp.
>>> >>
>>> >> Or try mofcomp.exe -class:forceupdate your.mof
>>> >>
>>> >> -- 
>>> >> Thanks,
>>> >> Joseph Calabig
>>> >>
>>> >> This posting is provided "AS IS" with no warranties, and confers no
>>> > rights.
>>> >>
>>> >> "Steve Adams" <steven.adams@nospam.com> wrote in message
>>> >> news:ueQ4exLVEHA.2944@tk2msftngp13.phx.gbl...
>>> >> >I am trying to modify sms_def.mof to collect some extra registry
>>> >> > information.
>>> >> > I have tried to follow the the whitepaper (published June 14, 2002)
>>> >> > But I am getting errors:
>>> >> >
>>> >> > The registry information I am trying to collect is:
>>> >> >
>>> >> >
>>> >> >
>>> >> > Windows Registry Editor Version 5.00
>>> >> >
>>> >> > [HKEY_LOCAL_MACHINE\SOFTWARE\CCCImageDetails]
>>> >> > "Build Date"="8/06/2004"
>>> >> > "Build Type"="CCCSTD"
>>> >> > "Build Version"="1.1.165"
>>> >> > "Imaged Date"="10/06/2004"
>>> >> > "Domain"="CCITY"
>>> >> > "AddStatus"="Complete"
>>> >> > "JoinTime"="10/06/2004 11:24:45 a.m."
>>> >> > "JoinVersion"="3.00 03-May-2004"
>>> >> >
>>> >> >
>>> >> >
>>> >> > The following has been added to the end of sms_def.mof
>>> >> >
>>> >> > // Workstation Build and Image details
>>> >> > // USed for Windows XP Workstation
>>> >> > // Build and Image Registry Keys
>>> >> >
>> //=====================================================================
>>> >> >
>>> >> > #pragma namespace ("\\\\.\\root\\cimv2")
>>> >> >
>>> >> > [DYNPROPS]
>>> >> > class CCCImageDetails
>>> >> > {
>>> >> >    [key]string Keyname="";
>>> >> >     string BuildDate;
>>> >> >     string BuildType;
>>> >> >     string BuildVersion;
>>> >> >     string ImagedDate;
>>> >> >     string Domain;
>>> >> >     string AddStatus;
>>> >> >     string JoinTime;
>>> >> >     string JoinVersion;
>>> >> > };
>>> >> >
>>> >> > [DYNPROPS]
>>> >> > instance of CCCImageDetails
>>> >> > {
>>> >> >    KeyName = "CCCImageDetails";
>>> >> >
>>> >> >
>>> >
>> [PropertyContext("local|HKEY_LOCAL_MACHINE\\SOFTWARE\\CCCImageDetails|Build
>>> >> > Date"),
>>> >> >          Dynamic, Provider("RegPropProv")] BuildDate;
>>> >> >
>>> >> >
>>> >
>> [PropertyContext("local|HKEY_LOCAL_MACHINE\\SOFTWARE\\CCCImageDetails|Build
>>> >> > Type"),
>>> >> >          Dynamic, Provider("RegPropProv")] BuildType;
>>> >> >
>>> >> >
>>> >
>> [PropertyContext("local|HKEY_LOCAL_MACHINE\\SOFTWARE\\CCCImageDetails|Build
>>> >> > Version"),
>>> >> >          Dynamic, Provider("RegPropProv")] BuildVersion;
>>> >> >
>>> >> >
>>> >
>> [PropertyContext("local|HKEY_LOCAL_MACHINE\\SOFTWARE\\CCCImageDetails|Imaged
>>> >> > Date"),
>>> >> >          Dynamic, Provider("RegPropProv")] ImagedDate;
>>> >> >
>>> >> >
>>> >
>> [PropertyContext("local|HKEY_LOCAL_MACHINE\\SOFTWARE\\CCCImageDetails|Domain
>>> >> > "),
>>> >> >          Dynamic, Provider("RegPropProv")] Domain;
>>> >> >
>>> >> >
>>> >
>> [PropertyContext("local|HKEY_LOCAL_MACHINE\\SOFTWARE\\CCCImageDetails|AddSta
>>> >> > tus"),
>>> >> >          Dynamic, Provider("RegPropProv")] AddStatus;
>>> >> >
>>> >> >
>>> >
>> [PropertyContext("local|HKEY_LOCAL_MACHINE\\SOFTWARE\\CCCImageDetails|JoinTi
>>> >> > me"),
>>> >> >          Dynamic, Provider("RegPropProv")] JoinTime;
>>> >> >
>>> >> >
>>> >
>> [PropertyContext("local|HKEY_LOCAL_MACHINE\\SOFTWARE\\CCCImageDetails|JoinVe
>>> >> > rsion"),
>>> >> >          Dynamic, Provider("RegPropProv")] JoinVersion;
>>> >> > };
>>> >> >
>>> >> >
>>> >> > #pragma namespace ("\\\\.\\root\\cimv2\\sms")
>>> >> >
>>> >> > [ SMS_Report (TRUE),
>>> >> >  SMS_Group_Name ("CCC Image Details"),
>>> >> >  SMS_Class_ID ("CHRISTCHURCH_CITY_COUNCIL|CCCImageDetails|1.0") ]
>>> >> >
>>> >> > class CCCImageDetails : SMS_Class_Template
>>> >> > {
>>> >> >    [SMS_Report (TRUE), key ]
>>> >> >        string KeyName;
>>> >> >     [SMS_Report(TRUE)]
>>> >> >      string BuildDate;
>>> >> >     [SMS_Report(TRUE)]
>>> >> >      string BuildType;
>>> >> >     [SMS_Report(TRUE)]
>>> >> >      string BuildVersion;
>>> >> >     [SMS_Report(TRUE)]
>>> >> >      string ImagedDate;
>>> >> >     [SMS_Report(TRUE)]
>>> >> >      string Domain;
>>> >> >     [SMS_Report(TRUE)]
>>> >> >      string AddStatus;
>>> >> >     [SMS_Report(TRUE)]
>>> >> >      string JoinTime;
>>> >> >     [SMS_Report(TRUE)]
>>> >> >      string JoinVersion;
>>> >> > };
>>> >> > // End
>>> >> >
>>> >> > The error I am getting is:
>>> >> >
>>> >> > M:\>mofcomp sms_defV2.mof
>>> >> > Microsoft (R) 32-bit MOF Compiler Version 5.1.2600.1106
>>> >> > Copyright (c) Microsoft Corp. 1997-2001. All rights reserved.
>>> >> > Parsing MOF file: sms_defV2.mof
>>> >> > MOF file has been successfully parsed
>>> >> > Storing data in the repository...
>>> >> > An error occurred while processing item 104 defined on lines 4688 -
>>> >> > 4708
>>> >> > in
>>> >> > file sms_defV2.mof:
>>> >> > Error Number: 0x80041026, Facility: WMI
>>> >> > Description: Class has instances
>>> >> > Compiler returned error 0x80041001
>>> >> >
>>> >> > any ideas ?
>>> >> >
>>> >> >
>>> >>
>>> >>
>>> >
>>> >
>>>
>>>
>>
>>
>
> 


Relevant Pages

  • Re: Serve up file from outside web application directory
    ... This posting is provided "AS IS" with no warranties, and confers no ... rights. ... "Response.Write" should be used for string text data. ... binary data and another write out string data), you can have a look and ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Sorting the Table.DefaultView
    ... If you type a column as string, ... In this case I pad the numbers with leading zeroes. ... This posting is provided "AS IS" with no warranties, and confers no rights. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: C# and System.Data.SqlClient.SqlException
    ... won't have rights to do this. ... happens or impersonating the app pool account in your code. ... > Procedure "" string ... not the domain account used on the portal's ...
    (microsoft.public.sharepoint.portalserver.development)
  • Re: XP security tab - group or user names odd entry
    ... Partly anyway - can't tell you why the rights are not removed with the user, ... connection - when you've got a good connection to your DC's, ... It was a string of digits ...
    (microsoft.public.windowsxp.security_admin)
  • Re: Parsing Request.Headers.ToString()
    ... the ASP.NET HttpRequest.Headers is a string ... so you can access a certain header in it ... This posting is provided "AS IS" with no warranties, and confers no rights. ...
    (microsoft.public.dotnet.framework.aspnet)