# 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>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://charles-bryant.gitbook.io/automating-the-microsoft-stack/infrastructure/dsc/managed_object_format.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
