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

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: Joe Boo (joe_at_boo.com)
Date: 06/20/04

  • Next message: - Karl: "Re: SMS 2.0 - Software inventory not updating"
    Date: Sun, 20 Jun 2004 12:04:28 +1200
    
    

    As I was getting this error on the primary server when ever I add a new
    class to the sms_def.mof that it is also added to the server namespace even
    though it is only the clients that I'm collecting the data from?

    Luckily I did it in the lab before modifying the production site. So I can
    clean out the name space and test in the lab again before moving the
    modifications over to production.

    Thanks for the info,

    /Steve

    "Joseph Calabig [MSFT]" <jcalabig@microsoft.com> wrote in message
    news:eqh7cdWVEHA.2828@TK2MSFTNGP10.phx.gbl...
    > 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 ?
    > >>> >> >
    > >>> >> >
    > >>> >>
    > >>> >>
    > >>> >
    > >>> >
    > >>>
    > >>>
    > >>
    > >>
    > >
    > >
    >
    >


  • Next message: - Karl: "Re: SMS 2.0 - Software inventory not updating"