0

I installed IIS using DSC a while back and since then changes have been made manually to the IIS configuration. Recently, someone ran Start-DSCConfiguration and it reported that IIS configuration had drifted and it will be corrected as per the original config defined in the DSC, but looks like this hasn't happened yet. My worry is it will after restarting the server/IIS.

We don't want the settings to be removed, so I ran Remove-DscConfigurationDocument. I can see pending.mof has been deleted but pending.mof.tmp resides in C:\Windows\System32\Configuration.

Does anyone know what is the pending.mof.tmp file? Also, if I restart my server, will it revert to original configuration, removing the manual changes?

Confounder
  • 469
  • 1
  • 8
  • 23
  • As far as I know, you don't have to worry about IIS configuration changing. IIS configuration information is written to the applicationhost.config file and other configuration files. If you use powershell to modify IIS information by writing to the IIS configuration file, restarting will not modify the content of the configuration file. So IIS information will always be retained. – Bruce Zhang Apr 14 '22 at 05:24

1 Answers1

0

Thanks Bruce.

After running Remove-DscConfigurationDocument on the IIS server and restarting, the configuration did not change and the manual IIS settings remained in place, which is what we wanted.

If the LCM configuration mode is ApplyAndMonitor, then DSC applies any new configuration when Start-Dscconfiguration is executed against the server and only logs drift - it automatically does not apply to correct drift in this mode.

Also, running the following returns any configuration that's drifted

PS> $Status = Get-DscConfigurationStatus
PS> $Status.ResourcesNotInDesiredState

This will also highlight any errors if configuration is not correct and LCM shows Pending Configuration (pendingconfiguration).

Confounder
  • 469
  • 1
  • 8
  • 23