Author Posts

June 19, 2015 at 9:43 am

Hi,

I have a target svr that is configured as a pull client and the LCM runs the consistency check at the configured interval, but I was wondering if there is anyway I could manually trigger the consistency check from powershell? Right now I do this by triggering the consistency scheduled task, but I'm not sure if this is recommend.

Start-ScheduledTask -TaskPath '\Microsoft\Windows\Desired State Configuration' -TaskName 'Consistency' -Verbose

Thanks

June 22, 2015 at 4:49 am

See "The DSC Book" (Resources menu / eBooks on this website). There's a WMI call you can make to rigger it. You need to be a bit careful in doing so; there's a reason the minimum interval is 15min. Make sure a check isn't already running before triggering another one.

June 22, 2015 at 6:30 am

Hi Don,

Sorry for being a pain, but I wasnt able to find that in the dsc book. Do you know the chapter by any chance?

Thanks

June 23, 2015 at 6:28 am

If you have a recent version of WMF (I think this one was in the november preview) you can use the cmdlet "update-dscconfiguration"

June 24, 2015 at 10:20 pm

Hi Joe, to force a consistency check you can use the following

Invoke-CimMethod -CimSession MyComputerName -Name PerformRequiredConfigurationChecks -Namespace root/Microsoft/Windows/DesiredStateConfiguration -Arguments @{Flags=[Uint32]2} -ClassName MSFT_DscLocalConfigurationManager -Verbose

Update-DscConfiguration will only perform a consistency check if the MOF file checksum fails and a new configuration is brought down

June 26, 2015 at 8:47 am

I use Test-DscConfiguration -cimsession -verbose

It will return whether the remote node(s) is(are) in the desired configuration by triggering the Test-TargetResource function of all the resources in the configuration. The verbose param is quite useful.

Is this what you were looking for?