DSC/MOF Confusion

This topic contains 3 replies, has 3 voices, and was last updated by  Craig 5 months, 3 weeks ago.

  • Author
    Posts
  • #71242

    Craig
    Participant

    Hello,

    I want to use DSC to configure multiple machines in the same manner. I am confused as to how 1 MOF can accomplish this (pull mode). If I create a configuration file for a node and compile it into a MOF, that MOF references THAT individual node, no? Surely I don't have to specify EVERY machine name that I want to be configured. Is someone able to clarify this?

    Thanks,
    Craig

  • #71245

    Eric
    Participant

    I had the same question when I started using DSC. Here is what I ended up doing:

    1. Write your configurations with only a Configuration block (no Node block)
    2. When you compile one of these configs, it will generate a localhost.mof file
    3. Change the name of the file to whatever you'd like, to describe the config
    4. Publish that config to the pull server
    5. Now make an LCM config with a "Node localhost" block which will specify the correct pull server, registration key, and ConfigurationNames (the one you uploaded to the pull server)
    6. Compile the LCM config and apply it to however many computers you want to have the configuration you referenced

    Again, that's just how I did it; there are probably other ways.

  • #71282

    Mark Gray (MSFT)
    Participant

    Craig,

    The contents of the MOF file that is created does not have any tie to a server so whether you specify a node name in the configuration or leave the node block out like Eric did, it will not matter. The node name specified in the configuration will only affect the name that the MOF file is given. The MOF file name can always be changed as Eric did. The rest of what Eric points out is as the steps he took are exactly right.

    Here is the documentation for how to set the meta-configuration up to use configuration names: https://msdn.microsoft.com/en-us/powershell/dsc/pullclientconfignames in case you are interested.

    MarkG

  • #71936

    Craig
    Participant

    Thanks everyone!

You must be logged in to reply to this topic.