Force a DSC Client to Refresh it's Configuration from the Pull Server

2015-10-13T17:00:00Z

Whilst testing Desired State Configuration settings and scripts, it can be quite useful to force a DSC client note to refresh it's configuration from the pull server. It's worth noting that each client node has a scheduled task called "Consistency". Opening Task Scheduler and manually triggering the scheduled task is one way in which the client can be forced to retrieve and apply the latest configuration from the DSC Pull server. It's hardly convenient though if you've become accustomed to driving things from the PowerShell command line. You can easily invoke the scheduled task using the Invoke-Command PowerShell commandlet:

PS \>  Invoke-Command -ComputerName <NodeName> -ScriptBlock {Get-ScheduledTask "Consistency" | Start-ScheduledTask}

Alternatively, you can run the command that is executed by the "Consistency" scheduled task, although it's a toughy to actually remember:

PS \>  Invoke-CimMethod -ComputerName <NodeName> -Namespace root/Microsoft/Windows/DesiredStateConfiguration -ClassName MSFT_DSCLocalConfigurationManager -MethodName PerformRequiredConfigurationChecks -Arg @{Flags = [System.UInt32]1 }

<NodeName> should of course be substitued for your actual DSC client node's hostname.

If you've landed here courtesy of your preferred search engine, then perhaps you'd like to read the main article.