PowerShell Desired State Configuration (DSC) Journey – Day 8

When we left off yesterday I was stuck getting my DSC Pull Server working properly.  The fix turned out to be easy.  Don’t configure a server to be a DSC Pull Server unless it’s Server 2012 R2.  Server 2012 doesn’t have the feature to make it work properly.  Once I upgraded my server to 2012 R2 and ran through the steps again everything worked great.

Now that my DSC Pull Server is working, can I pull an actual configuration from it?  I have a brand new Server 2012 R2 Server Core VM that isn’t configured for anything right now.  Here is the Configuration I would like to push to it.

I skipped a bunch of testing this on my part, but don’t set an IP address without first setting the DNS Address.  It doesn’t work out very well.  I Invoke the Configuration by running a command like this (all these values are made up)

The network adapter on the VM is currently configured for DHCP.  Let’s get this Configuration sent to the Pull Server and have my Server Core VM pull it.  Again, we are following the steps in the DSC E-Book.

I run Get-DSCLocalConfiguration manager on my Server Core VM and can see that the RefreshMode is set to Push:

First step.  Create a new GUID.

Second step.  Copy the file.

Third step.  Create a new CheckSum.

Fourth step.  Tell a computer to Pull a Configuration.

We run that script and magic happens (after about 10 minutes).  The server is configured with the static IP, Gateway, SubnetMask and DNS Server Addresses that I specified.  We can also see now that the server is Configured for Pull mode.


Now, something I discovered while writing this article.  I tested this before I wrote this.  I set my VM back to using DHCP and then watched as the VM was checking in, but not doing anything.  While waiting to see if anything was happening, I got around to reading this article by Steven Murawski.  And wouldn’t you know it.  I needed to change a setting on the Local DSC Configuration Server on my Server Core VM.  The updated TechNet documentation can be found here.

Here is my updated SetPullModeConfiguration.

And the output from DSC:

And the screenshot for more proof:


The FrequencyMins don’t match what I set, I am guessing there are limits to how low those can go.  Once I did that it pulled the correct Configuration down and applied it, returning the Server Core VM to the correct IP settings.