MIF File Format for Extended Inventory

SCCM can collect MIF files to extend hardware inventory collected for a computer.  Generally, MIF files are generated by some other process and are then collected during the hardware inventory cycle.  MIFs are generally used when the data to be collected must be processed into a readable form prior to collection or requires API calls to obtain the data (such as when the data isn’t available via WMI).

MIF files follow a standardized format that is nested.  There is only one “component” per file and the format follows the general model:

START COMPONENT
  START GROUP
    START ATTRIBUTE
    END ATTRIBUTE
    ...
  END GROUP
  ...
END COMPONENT

Components

At the component level, several items can be defined to clarify the purpose of the file.  Some of these items are optional and are not consumed by SCCM.

START COMPONENT
  NAME = "Name of this component or file"
  [DESCRIPTION = "Descriptive text"]
  ...
END COMPONENT

Groups

Components can have one or more groups defined within them (and in fact, must have at least one).  Again, some of the data is optional.

START GROUP
  NAME = "Group Name"
  ID = n
  CLASS = "Publisher|GroupClass|Version"
  [DESCRIPTION = "Descriptive text"]
  [KEY = n[,n]...]
  ...
END GROUP

For the Class attribute, each group must have a unique class definition that aligns it with a particular schema of attributes.  This allows SCCM to combine groups in the MIF file into multiple entries that show up in the Resource Viewer for a computer.

The ID attribute must be a unique number for each group defined within the scope of the file, even if groups are of different clases.

The Key attribute, if specified, defines which attributes (by ID number) are the primary key to use.  In essence, if another group within the same file or a future MIF has the same data for group class and the value of the key attributes, then it will replace this version of the data.  Typically, you want to set the key to be something that is not likely to change but is unique to each particular instance of the group.  For example, a MAC address, WWN, or component display name.

NOTE: The ID property must come before the CLASS property.

Attributes

Groups can have one ore more attributes defined in them.  Here’s the syntax for an attribute:

START ATTRIBUTE
  NAME = "Attribute Name"
  ID = n
  [DESCRIPTION = "Descriptive text"]
  TYPE = datatype
  VALUE = value
END ATTRIBUTE

Just like groups above, each attribute within a group must have a unique ID number.  This is the same ID number that would be referenced by the Key property of the containing group.

NOTE: The NAME and ID properties must come before the TYPE property (which must come before the VALUE property).

Attribute Data Types

The following MIF data types are supported by SCCM:

  • INTEGER or INT – A 32-bit signed integer
    Can be listed in the following ways:
    nnn – decimal
    0nnn – octal
    0xnnn – hexadecimal
  • GAUGE – A 32-bit unsigned integer that may increase or decrease
  • COUNTER – A 32-bit unsigned integer that never decreases
  • STRING(n) or DISPLAYSTRING(n) – A displayable string of n octets, enclosed within double-quotes
    Should use escape characters for the following:
    \a = CHR(7) (Bell)
    \b = CHR(8) (Backspace)
    \f = CHR(12) (Form Feed)
    \n = CHR(10) (New Line)
    \r = CHR(13) (Carriage Return)
    \v = CHR(11) (Vertical Tab)
    \\ = Backslash
    \” = Double-quote
    \xhh = Character specified in hex
    \ooo = Character specified in octal
  • OCTETSTRING(n) – A string of n octets, not necessarily displayable, enclosed within double-quotes
  • DATE – A 28-byte displayable string in the format:
    yyyymmddhhnnss.zzzzzz+TTT
    yyyy = Year in 4 digits
    mm = Month in 2 digits
    dd = Day in 2 digits
    hh = Hour in 2 digits
    nn = Minute in 2 digits
    ss = Seconds in 2 digits
    zzzzzz = Parts of seconds in 6 digits
    +TTT = Time zone offset (+ or – and then minutes offset from UTC)

Post a Comment

You must be logged in to post a comment.