# DSC Doesn't restore the configuration

**URL:** https://forums.powershell.org/t/dsc-doesnt-restore-the-configuration/8604
**Category:** DSC
**Created:** [May 12, 2017, 7:13am UTC](https://forums.powershell.org/t/dsc-doesnt-restore-the-configuration/8604 "2017-05-12T07:13:33Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![pepijn](https://avatars.discourse-cdn.com/v4/letter/p/f1d935/32.png) [@pepijn](https://forums.powershell.org/u/pepijn)
#### Post date: [May 12, 2017, 7:13am UTC](https://forums.powershell.org/t/dsc-doesnt-restore-the-configuration/8604/1 "2017-05-12T07:13:33Z")

</div>

Hi There!  
Seems something went wrong with my previous post so that’s why i’m posting it again.

Recently i started the PowerShell: Beginner learning path and got stuck at the DSC part.

I followed the following steps:

Step 1:

```
configuration Configname {
Import-DscResource -ModuleName 'PSDesiredStateConfiguration'
    Node $Computername {
        Windowsfeature IIS{
            Name = 'web-server'
            Ensure = 'Present'
        }
    }
}
$computername = 'serverx'
ConfigName -outputpath c:\DSC\Config
```

Result:

```
Directory: C:\DSC\Config

Mode LastWriteTime Length Name                                                                                                                                         
---- ------------- ------ ----                                                                                                                                         
-a---- 12/05/2017 13:45 1858 serverx.mof
```

Step 2:

```
PS C:\Windows\system32> Start-DscConfiguration -Path C:\DSC\Config\ -ComputerName 'serverx' -Verbose -Wait
```

```
VERBOSE: Perform operation 'Invoke CimMethod' with following parameters, ''methodName' = SendConfigurationApply,'className' = MSFT_DSCLocalConfigurationManager,'namespaceName' = root/Microsof
t/Windows/DesiredStateConfiguration'.
VERBOSE: An LCM method call arrived from computer servery with user sid S-1-5-21-1375646641-2800936017-3851355188-4723.
VERBOSE: [serverx]: LCM: [Start Set]
VERBOSE: [serverx]: LCM: [Start Resource] [[WindowsFeature]IIS]
VERBOSE: [serverx]: LCM: [Start Test] [[WindowsFeature]IIS]
VERBOSE: [serverx]: [[WindowsFeature]IIS] The operation 'Get-WindowsFeature' started: web-server
VERBOSE: [serverx]: [[WindowsFeature]IIS] The operation 'Get-WindowsFeature' succeeded: Web-Server
VERBOSE: [serverx]: LCM: [End Test] [[WindowsFeature]IIS] in 1.8520 seconds.
VERBOSE: [serverx]: LCM: [Start Set] [[WindowsFeature]IIS]
VERBOSE: [serverx]: [[WindowsFeature]IIS] Installation started...
VERBOSE: [serverx]: [[WindowsFeature]IIS] Continue with installation?
VERBOSE: [serverx]: [[WindowsFeature]IIS] Prerequisite processing started...
VERBOSE: [serverx]: [[WindowsFeature]IIS] Prerequisite processing succeeded.
WARNING: [serverx]: [[WindowsFeature]IIS] Windows automatic updating is not enabled. To ensure that your newly-installed role or feature is automatically updat
ed, turn on Windows Update.
VERBOSE: [serverx]: [[WindowsFeature]IIS] Installation succeeded.
VERBOSE: [serverx]: [[WindowsFeature]IIS] Successfully installed the feature web-server.
VERBOSE: [serverx]: LCM: [End Set] [[WindowsFeature]IIS] in 50.0290 seconds.
VERBOSE: [serverx]: LCM: [End Resource] [[WindowsFeature]IIS]
VERBOSE: [serverx]: LCM: [End Set]
VERBOSE: [serverx]: LCM: [End Set] in 53.1560 seconds.
VERBOSE: Operation 'Invoke CimMethod' complete.
VERBOSE: Time taken for configuration job to complete is 59.469 seconds
```

Step 3:

```
Invoke-Command -ComputerName serverx {Remove-WindowsFeature -Name web-server -Restart}
```

```
Success Restart Needed Exit Code Feature Result PSComputerName                                                                                            
------- -------------- --------- -------------- --------------                                                                                            
True Yes SuccessRest... {Common HTTP Features, Default Document, D... serverx                                                                                            
WARNING: You must restart this server to finish the removal process.
```

Step 4:

```
Test-DscConfiguration -CimSession serverx
False
```

and there lies the problem, even after 15 minutes or longer i still get the “false” and the web-server feature isn’t restored.

Anyone any suggestions on what i’m doing wrong?

---

<div class="post-metadata">

### Author: ![doctordns](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/doctordns/32/167_2.png) [@doctordns](https://forums.powershell.org/u/doctordns)
#### Post date: [May 12, 2017, 7:38am UTC](https://forums.powershell.org/t/dsc-doesnt-restore-the-configuration/8604/2 "2017-05-12T07:38:54Z")

</div>

How have you configured the LCM on the pull client?

---

<div class="post-metadata">

### Author: ![pepijn](https://avatars.discourse-cdn.com/v4/letter/p/f1d935/32.png) [@pepijn](https://forums.powershell.org/u/pepijn)
#### Post date: [May 12, 2017, 8:05am UTC](https://forums.powershell.org/t/dsc-doesnt-restore-the-configuration/8604/3 "2017-05-12T08:05:41Z")

</div>

I think i missed that part or it hasn’t been addressed yet :')

---

<div class="post-metadata">

### Author: ![doctordns](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/doctordns/32/167_2.png) [@doctordns](https://forums.powershell.org/u/doctordns)
#### Post date: [May 12, 2017, 8:48am UTC](https://forums.powershell.org/t/dsc-doesnt-restore-the-configuration/8604/4 "2017-05-12T08:48:03Z")

</div>

You need to configure the LCM.

There is an excellent article on how to do this: [https://msdn.microsoft.com/en-us/powershell/dsc/metaconfig](https://msdn.microsoft.com/en-us/powershell/dsc/metaconfig)

This document is now up to date too! I know that! 🙂

In the LCM configuration, you need to set “ConfigurationMode”.

---

<div class="post-metadata">

### Author: ![pepijn](https://avatars.discourse-cdn.com/v4/letter/p/f1d935/32.png) [@pepijn](https://forums.powershell.org/u/pepijn)
#### Post date: [May 12, 2017, 9:42am UTC](https://forums.powershell.org/t/dsc-doesnt-restore-the-configuration/8604/5 "2017-05-12T09:42:26Z")

</div>

I’ll read it, thanks for the help!

---

<div class="post-metadata">

### Author: ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)
#### Post date: [May 16, 2024, 9:16pm UTC](https://forums.powershell.org/t/dsc-doesnt-restore-the-configuration/8604/6 "2024-05-16T21:16:42Z")

</div>


