Wednesday, 14 September 2016

Dude! Where's my config?

One of the first things I have learnt working with DSC is that the Local Configuration Manager (LCM) does things on a schedule and that it is quite a patient little service. This is most obvious in a Pull server setup.

I copy a config (and checksum file) to the Pull server and then wonder why nothing is happening on the target node. The first thing that comes to mind is "my Pull server ain't configured right". So, naturally I have a look at the LCM on the target node:

PS   C:\>Get-DscLocalConfigurationManager -CimSession $target_node
The LCM says it is configured for Pull and looks happy so why the heck is my configuration not being applied? Well, the answer is in the RefreshFrequencyMins property of the LCM (which is 30 by default). I could end up waiting for 30 minutes for anything to happen, or I could just tell the LCM to get on with it:

PS   C:\>Update-DscConfiguration -ComputerName $target_node
That will output some details on the job that is carrying out the work, which you can interrogate like so:

PS   C:\>Receive-Job -Id $job_id -keep

No comments:

Post a Comment