Chris Nackers Blog

Oh man, what did i get myself into now....

March 2009 - Posts

Creating a collection to query for MOF version

Working with MOF’s is one the black arts of SMS. However, working with your MOF opens up some very cool possibilities for getting further information into your SQL Database and having insight into your environment.

I pieced together some info from various people on MyITForum to be able to create a collection based on a MOF version as well as create a web report that you run against the information as well.  I added this information into my MOF when i working on adding in the inventory extensions for Mcafee products.  I added a few other things to MOF at this time, but i wanted to post the core information for being to able to tell what MOF version your clients are running.  That way when you make a change, you will be able to make sure that the clients are on the latest MOF.

Most of my information came from Sherry’s great post here:

http://www.myitforum.com/articles/8/view.asp?id=9543

 

MOF Extension

Here is the MOF information you need to either add to your sms_def.mof or you custom.mof:

//`'`*._.*`'`*-
//  MOFFileRevision Data Class
//`'`*._.*`'`*-

    #pragma namespace("\\\\.\\root\\CIMV2")
    #pragma deleteclass("MofFileRevision", NOFAIL)

    [DYNPROPS]
    class MofFileRevision
    {
    [key] string    KeyName;
    string        MofRevision;
    string        ModifiedBy;
    string        ModifiedDate;
    };

//`'`*._.*`'`*-
//  Instance of MOFFileRevision
//`'`*._.*`'`*-

    [DYNPROPS]
    instance of MofFileRevision
    {
    KeyName="MOF File Revision";
      MofRevision="2003.3.1";
    ModifiedBy="YourNameHere";
    ModifiedDate="3-27-2009";
    };

//`'`*._.*`'`*-
//  MOFFileRevision Reporting Class
//`'`*._.*`'`*-

    #pragma namespace("\\\\.\\root\\CIMV2\\SMS")
    #pragma deleteclass("MofFileRevision", NOFAIL)

    [SMS_Report(TRUE), SMS_Group_Name("MOF File Revision"), SMS_Class_ID("MofFileRevision")]
    class MofFileRevision : SMS_Class_Template
    {
    [SMS_Report(TRUE),key]    string   KeyName;
    [SMS_Report(TRUE) ]    string   MofRevision;
    [SMS_Report(TRUE) ]    string   ModifiedBy;
    [SMS_Report(TRUE) ]    string   ModifiedDate;
    };

//  <:[-<>

 

Collection Query

Here is my collection query for maintaining my clients.  I made sure to ignore obsolete clients and machines that don’t have an active SMS client because i didn’t want to see all the “not accepted” when i look at the advertisement status .  Here you can also see that my MOF is at 2003.3.1 which is my way of saying SMS 2003, Service Pack 3, and revision 1. 

My collection query:

image

Posted: Mar 27 2009, 01:35 PM by cnackers | with 1 comment(s)
Filed under: