Stop-Dsc configuration which is running/stuck

This topic contains 8 replies, has 4 voices, and was last updated by Profile photo of Nitin Gupta Nitin Gupta 2 months, 2 weeks ago.

  • Author
    Posts
  • #54317
    Profile photo of Amit Batham
    Amit Batham
    Participant

    Hello Team,

    I am a newbie to DSC

    I made a push server & created a script to install the softwares on client. It worked fine when i pushed 3 softwares but not added "Adobe Acrobat" as well to push in same script. Script never finished .. looks like hung. I used CTRL+Break but if i check Get-dsclocalconfgurationmanager .. status is Busy & I can't run the script again.. tried stopping it remotely using below command but it keeps running/executing... Please help

    Stop-DscConfiguration -Force -CimSession servername

    • This topic was modified 2 months, 2 weeks ago by Profile photo of Amit Batham Amit Batham.
  • #54319
    Profile photo of Daniel Krebs
    Daniel Krebs
    Participant

    Have you tried to kill the Adobe Acrobat installation process (probably an msiexec process) remotely via Invoke-Command?

    Invoke-Command -ComputerName lon6utinfint26 -ScriptBlock { Get-Process -Name msiexec | Stop-Process -Force }

  • #54320
    Profile photo of Amit Batham
    Amit Batham
    Participant

    Thanks for reply.

    I am not seeing any msiexec process running on client.

    Is there anyway I can stop LCM on client ?

  • #54321
    Profile photo of Daniel Krebs
    Daniel Krebs
    Participant

    You can try the following script with code borrowed from https://msdn.microsoft.com/PowerShell/DSC/troubleshooting

    $ScriptBlock = {
        $dscProcessID = Get-WmiObject msft_providers | 
            Where-Object { $_.provider -like 'dsccore' } | 
                Select-Object -ExpandProperty HostProcessIdentifier 
    
        Get-Process -Id $dscProcessID | Stop-Process
    }
    
    Invoke-Command -ComputerName lon6utinfint26 -ScriptBlock $ScriptBlock
    
  • #54333
    Profile photo of Arie H
    Arie H
    Participant

    Hi,

    On the node, go to C:\windows\system32\configuration
    and remove the pending.mof

  • #54335
    Profile photo of Nitin Gupta
    Nitin Gupta
    Participant

    I would recommend using Remove-DscConfigurationDocument cmdlet instead.

    Remove-DscConfigurationDocument -Stage Pending
    
  • #54379
    Profile photo of Amit Batham
    Amit Batham
    Participant

    Hello Daniel,

    I ran your script , it completed & asked mt stop WmiPervSE process & I did. But when i checked dsclocalconfigmanager after that, still state is showing Busy.

    ActionAfterReboot : ContinueConfiguration
    AllowModuleOverWrite : False
    CertificateID :
    ConfigurationDownloadManagers : {}
    ConfigurationID :
    ConfigurationMode : ApplyAndMonitor
    ConfigurationModeFrequencyMins : 15
    Credential :
    DebugMode : {NONE}
    DownloadManagerCustomData :
    DownloadManagerName :
    LCMCompatibleVersions : {1.0, 2.0}
    LCMState : Busy
    LCMStateDetail : LCM is performing a consistency check.
    LCMVersion : 2.0
    StatusRetentionTimeInDays : 10
    PartialConfigurations :
    RebootNodeIfNeeded : False
    RefreshFrequencyMins : 30
    RefreshMode : PUSH
    ReportManagers : {}
    ResourceModuleManagers : {}

    How can I find the Pull/Push server name from client directly ?

  • #54382
    Profile photo of Daniel Krebs
    Daniel Krebs
    Participant

    You'll probably need to restart the machine. It looks like from your post that a pull server is not configured. To determine the origin of the previous configuration push you can look into the DSC event log or open the pending.mof on the target node to check where the configuration was generated which is less reliable. More information here: https://msdn.microsoft.com/en-us/powershell/dsc/troubleshooting

  • #54455
    Profile photo of Nitin Gupta
    Nitin Gupta
    Participant

    If DSC is running consistency check and if LCM crashes, DSC will try to recover from the crash by running the consistency check again almost immediately. You need the combination of removing documents and killing the process.
    1) Remove Pending and Current Stage using Remove-DscConfigurationDocument cmdlet
    2) Kill the process as Daniel suggested.
    3) Wait for 1-2 mins for DSC to recover from the crash.

You must be logged in to reply to this topic.