PowerTip: Use DSC to Remediate a Server

PowerTip: Use DSC to Remediate a Server

  • Comments 3
  • Likes

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

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment
  • 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?

  • @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.