Share via

DesiredStateConfiguration

Anonymous
2022-05-20T19:22:52+00:00

I applied a DSC Configuration and it was successful applied through both the commands, either by using

start-dscconfiguration -wait -force -path <Path of the folder containing MOF file> 
or
$paramforSendConfigurationApplyMethod = @{
ConfigurationData = $dataInUint8Format
force = $True
}
Invoke-CimMethod -CimClass $cimClass -CimSession $wsmanSession -MethodName SendConfigurationApply -Arguments $paramforSendConfigurationApplyMethod -Verbose 

When I tried to test the configuration , with the below command
Test-DscConfiguration -ReferenceConfiguration <Path of localhost.mof> , the output I got is
InDesiredState             : True
ResourcesInDesiredState    : {[RegistryPolicyFile]Registry(POL): 
                             HKLM:\Software\Microsoft\Windows\CurrentVersion\Policies\Ext\RunThisTimeEnabled, 
                             [RefreshRegistryPolicy]ActivateClientSideExtension}
ResourcesNotInDesiredState : 
ReturnValue                : 0
PSComputerName             : Localhost
However, when I tried to execute the Test configuration with the CIM method
$paramforTestConfiguration = @{
ConfigurationData = $dataInUint8Format
}
invoke-CimMethod -CimClass $cimClass -CimSession $wsmanSession -MethodName TestConfiguration -Arguments $paramforTestConfiguration | format-list
, I got the results as null

InDesiredState             : False
ResourcesInDesiredState    : 
ResourcesNotInDesiredState : 
ReturnValue                : 0
PSComputerName             : localhost

I am not sure why for the same DSC configuration, both "Test" commands are displaying different output.i.e., one output says
that the DSC is in Desired state but the other is not.

I am testing this in the local stand alone development windows computer (ws2016)
Windows for home | Windows 10 | Security and privacy

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

1 answer

Sort by: Most helpful
  1. paulr0511 45,605 Reputation points Independent Advisor
    2022-05-20T20:08:53+00:00

    Good day VijayanandArunagiri! I am glad to be able to provide assistance to you today. I would suggest to post this query to our neighbor forum from the link below. They are more oriented on with regards to this type queries/issues and there will be IT Pros/System Admins/Server Admins/AD Admins who are available that will be able to fulfill your query out there.

    https://docs.microsoft.com/answers/topics/46444...

    Regards,

    Paul R.

    Was this answer helpful?

    0 comments No comments