Creating one MOF for many servers

I created a very basic DSC configuration that just enables the ‘DSCService’ WindowsFeature.

I set the node to ‘localhost’.

I executed and it produced a localhost MOF file. I tried a Start-DscConfiguration and specified a remote server for -ComputerName and it said the computer-specific MOF file for the remote server servername does not exist.

With DSC, do you have to create a mof file for each remote server you want to remotely push to? Is there a way to just create one generic MOF file and use it with any remote server?

Thank you!

Start-DscConfiguration uses its -computername parameter to look for the actual MOF filename, which is why it’s failing. You could just use Copy-Item to create one copy of the MOF for each computer you planned to target.

It’s more just the way Start-DscConfiguration was implemented than a restriction of any kind. In Pull mode, which is what most people are expected to do, you can have just one physical MOF, with multiple machines configured to pull it.


So I take it from your reply, that with the push method, I will need a MOF for each destination node, sadly. I also am taking away that it is not the case for the pull method (which most people do).


Yeah, more or less. I mean, there’s some hacky stuff you can do, but end of the day Start-DscConfiguration really wants a 1:1 correlation.


When using the ‘push’ scenario, do the modules (such as one downloaded like xSharePoint) need to exist at the destination node as well?

You can “cheat” by running it locally so you don’t end up using the -computername command. basically write a little wrapper function that copies the mof out then executes the Start-DSCConfiguration locally on that host.

Shouldn’t take too long to write.

All modules (declared in the mof) always need to be present on the target node. During a push scenario, v4 will require you to copy them over, but you can setup a repo in v5 that will work. Both v4 and v5 will let you use a centralized repo in pull mode.

Good article (not my own) on it here:

EDIT: I edit because my typing sucks