Configure PowerShell DSC Local Configuration Manager Refresh

Configure the Windows PowerShell Desired State Configuration (DSC) refresh parameters.

John Savill

April 12, 2014

1 Min Read
config

Q: How can I control how often Local Configuration Manager checks the Windows PowerShell Desired State Configuration for configuration drift?

A: Local Configuration Manager is the Windows PowerShell Desired State Configuration (DSC) engine. Once a PowerShell DSC has been applied to a server, Local Configuration Manager periodically checks whether the configuration is still valid or if drift has occurred. If the ConfigurationMode property is set to ApplyAndAutoCorrect, then at the configured interval, if drift has occurred, it will reapply the required configuration. To control how often this occurs, you need to create a configuration and apply it. For example, in the following code I set the interval to every 30 minutes (which is a multiple of the refresh frequency at which the server pulls configuration from the pull server, if it's configured in Pull mode).

Configuration DemoConfig{    Node "SAVDALHV01"    {        LocalConfigurationManager        {            ConfigurationMode = "ApplyAndAutoCorrect"            ConfigurationModeFrequencyMins = 30 #must be a multiple of the RefreshFrequency and how often configuration is checked            RefreshFrequencyMins = 15  #15 is minimum and this is how often configuration is pulled from pull server        }    }}DemoConfig -OutputPath "C:Usersadministratordsc"Set-DscLocalConfigurationManager -Path "C:Usersadministratordsc" -VerboseGet-DscLocalConfigurationManager

About the Author

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like