Managed Object Format

The Manged Object Format (MOF) is a beautiful thing. It is a cross platform industry standard way of configuring servers. The MOF isn't a DSC thing. It just so happens that you can write DSC Configurations and generate a MOF files from them. Tools like Chef and Puppet can also write MOF files, you can write MOF files with your home grown tool, or by hand (if you like punishment).

MOF files are not only for Windows they are just as valuable to configure Linux. Like I said, the MOF file is a beautiful thing. With the introduction of DSC you can now configure a cross platform infrastructure from one tool and you don't have to stay locked into one tool or another.

Create MOF from DSC Configuration

Invoke the configuration to create a MOF file. The MOF will be placed in a child directory of the current directory. You can use the OutputPath parameter to specify the path to save the MOF file. If you use external configuration data it will be merged with the configuration to create the MOF. The MOF is the file that is executed against the nodes.

#Generate MOF
MyConfiguration -OutputPath "C:\_DSC\Configurations\" -MyTargetNodeName "Server001" -MyGroupName "TestGroup" 

#Generate MOF with configuration data file
MyConfiguration -ConfigurationData C:\_DSC\Data\ShareConfigData.psd1 -OutputPath "C:\_DSC\Configurations\"

Secure MOF

Create encrypted MOF to protect credentials - http://blogs.msdn.com/b/powershell/archive/2014/01/31/want-to-secure-credentials-in-windows-powershell-desired-state-configuration.aspx

Last updated