Desired State Configuration

Setting up a server is one thing, keeping it with that configuration is another. Desired State Configuration (DSC) is a set of Power Shell features that allows us to configure and maintain a configuration of Windows Server 2019, to make sure every server is in the desired state. We could do this with scripts on a timed job, but this is a good way to automate this process as well.

Using DSC, we can

  • Install and remove server roles and features

  • Create registry settings

  • Create files and folders and manage directories

  • Start and stop processes

  • Manage groups and users

  • Run other PowerShell scripts

Most importantly, we can examine a server to see if it is in its desired state and if not, fix it!

There are a range of built-in providers in DSC that enable this functionality.

Note that one of the providers is called File, I can use this to automatically copy an important file to any server.

Also notice the provider WindowsFeature. To see which features I can add, I can use the command

Get-WindowsFeature

I am not going to show the output, it scrolls off the page! 

Last updated