How do I resolve “Cannot invoke the SendConfigurationApply method.” when performing Start-DscConfiguration?

后端 未结 2 1639
梦谈多话
梦谈多话 2021-01-02 00:12

Another way to phrase the question less specifically: What is the correct way to \'reset\' the DSC processes on a target machine?

I\'ve created a DSC configuration

相关标签:
2条回答
  • 2021-01-02 00:26

    You could also try executing the start-dscconfiguration command with the -Force option

    Start-DscConfiguration -Force ...
    
    0 讨论(0)
  • 2021-01-02 00:31

    I've found the following works pretty well to reset DSC. Note this will delete the local configuration, so you will need to re-apply the machinename.meta.mof file.

    #Remove all mof files (pending,current,backup,MetaConfig.mof,caches,etc)
    rm C:\windows\system32\Configuration\*.mof*
    #Kill the LCM/DSC processes
    gps wmi* | ? {$_.modules.ModuleName -like "*DSC*"} | stop-process -force
    

    At this point you have a clean system ready to be configured using Set-DscLocalConfigurationManager and updated using Update-DscConfiguration -Wait -Verbose -CimSession machinename

    So far the only thing this hasn't fixed is a corrupted $env:psmodulepath or missing scheduled tasks for Consistency/Reboot checks. Update: According to this item on connect the scheduled tasks for Consistency/Reboot were removed in the WMF 5.0 February preview.

    0 讨论(0)
提交回复
热议问题