PowerTip: Use DSC to Remediate a Server

Summary: Use Windows PowerShell 4.0 DSC to easily remediate a server.

Hey, Scripting Guy! Question How can I see what has been fixed on the server before I re-apply a DSC configuration?

Hey, Scripting Guy! Answer Use the –Verbose switch when you call the Start-DSCConfiguration cmdlet:

Start-DscConfiguration -Path "C:\DSC\Configurations\" -Wait -Verbose

Comments (2)

  1. @Tore,

    Per this article (http://blogs.technet.com/b/heyscriptingguy/archive/2014/03/12/using-powershell-4-0-dsc-to-control-configuration-drift.aspx)
    I agree that correct answer should be


    No need to pass any additional information in, but I believe this is dependent on the configuration having the ability to perform a test. I think if you’re using the pre-defined resources you’re golden, but if you’re rolling your own, or using community based
    resources this may not return the desired results.

  2. Tore Groneng says:

    hi, this is quite misleading. The command example is applying a DSC configuration and you are using the verbose flag to show what is going on. The question was how can you display what needs to be fixed BEFORE you re-apply a DSC configuration. I would guess that test-dscconfiguration or get-dscconfiguration was more correct? Or am I missing something?