|Importing and Exporting MOF Files in the SMS Administrators Console|
By: Daniel Rich
Posted On: 3/10/2005
Using a MOF file created by someone else is a great way to benefit from someone else’s expertise and to extend your knowledge and capabilities. If you have developed a great report or query, a MOF file is a great way to share your accomplishment. There are several MOFs already available on MyITForum, and more are added as we work together in the forums to solve members’ issues. I’ll cover what a MOF is, the different types of MOFs and how to import and export a MOF file. At the end of the article, I have included a link to a Blogcast I did that demonstrates the procedures for importing and exporting MOFs.
What is a MOF file?
Well, it really depends on who you ask*. In this case, MOF stands for Managed Object Format, and is defined in the Distributed Management Task Force (DMTF) specifications for the Common Information Model (CIM) (http://www.dmtf.org/home). OK – some of you are already groaning at this explanation. All this really means is that we are using an industry standard file for specifying access to data objects and that what you learn about MOF files will probably carry over into other products. The industry has very complex answers and definitions for this question. Our definition will be much simpler and narrow – it’s how we share queries and reports.
*The Object Management Group (OMG) defines MOF as Meta-Object Facility, which defines a specification for describing technology neutral metadata models, like UML, XML Interchange (XMI), etc. The DTMF and OMG have entered into an alliance to bridge the CIM and UML/XMI worlds.
MOF file differences
There are two MOF files that you will routinely import and export – query MOFs & report MOFs. A query MOF is usually simpler and has six fields of data:
Expression (a WQL query)
A report MOF has at least sixteen fields of data, though it may have many more, depending on the complexity of the report. Here are the basic fields:
One difference you may have noticed is that the queries use WQL & reports use SQL. This is one reason it is good to use the MOF files to share your information, as someone may otherwise try to cut-and-paste the wrong query type into their console.
Importing a MOF file
For both reports and queries, the process is the same. Right-click on the appropriate node (Reports or Queries, but NOT Reporting), go down to All Tasks & the select Import Objects. The Import Objects Wizard will launch and guide you through the process. Click Next to begin. Enter in the name of the MOF you want to import, including the pull path, or click Browse. Once you have your MOF file listed in the box, click Next. Review the object to be imported and click Next. A dialog will be presented for you to review the comments associated with the file. When you have read it, click Next and the import process will begin.
Each MOF file contains the information that tells SMS how to import the object, so it doesn’t matter whether you launched the import wizard from the Reports node or the Queries node. The wizard will put the object into the correct node.
Right-click on the correct node and select Refresh. You will see the new query or report now displayed in the tree.
Exporting a MOF file
Again, the process is the same for both reports and queries. Right click on the appropriate node, choose All Tasks & select Export Objects. The Export Objects Wizard will launch. You will be given a list of objects, which you can select by checking the box beside them. Click Next. Provide a name for the object, including the full path for the output file. You should also provide a comment to describe the MOF file. This comment will be written into the file and will provide useful information for anyone who looks at the file. Click Next & then click Finish. Your MOF file will be written to the location you specified and is now ready for sharing.
You can view my Blogcast at http://www.smsblogcasts.com/Blogcasts/Contributor/DRich/SMSAddMofDR.htm
For More Information
If you are interested in finding out more information, visit the following web sites: