Desired State Configuration (DSC) is the next phase in the development of Windows Power-Shell, a process that began over a decade ago and first appeared as a Windows component in Windows PowerShell 1.0 (released in 2006). Windows Server 2012 expanded the functionality of Windows PowerShell by using the command line infrastructure as an underlayment for all of the new graphical capabilities in the operating system. Windows PowerShell 3.0 added thousands of new cmdlets, making it possible to use the command line to accomplish any
task you might otherwise perform in Server Manager.
In Windows PowerShell 4.0, DSC provides a new scripting model that enables administrators to create modules called configurations, which consist of nodes representing computers and resources that define elements that administrators want to define as part of the configuration for a particular node.
For example, a relatively simple script to deploy a Web server might appear as follows:

Configuration CompanyWeb
{
Node “ServerB”
{
WindowsFeature InstallIIS
{
Ensure = “Present”
Name = “Web-Server”
}
File CopyWebSite
{
Ensure = “Present”
Type = “Directory“
Recurse = $true
SourcePath = $WebsitePath
DestinationPath = “C:\inetpub\wwwroot”
Requires = “[WindowsFeature]InstallIIS”
}
}
}

In this script, the Node block identifies the computer to be configured and the WindowsFeature and File blocks are both built-in resources that you can use to define the configuration you want to deploy. The WindowsFeature block specifies that the configuration must install the Web-Server role, and the File block copies the content files for a website to the node from a location defined by the $WebsitePath variable. DSC includes many other built-in resources that you can use to define more complex configuration elements, such as system services, registry settings, environment variables, and user and group accounts. It is also possible for administrators to create their own custom resources.
Once you have created a configuration script, you can deploy it by executing the defined configuration name—in this case CompanyWeb—from a Windows PowerShell prompt.
In large enterprise deployments, administrators can create a centralized DSC server by installing the PowerShell Desired State Configuration Service, a Windows PowerShell feature that uses the Internet Information Services Web server to deploy configuration logic and data to nodes all over the network. After storing DSC configuration scripts on the server, administrators can configure nodes to check periodically for changes in their configurations or configure the server to push new configurations to nodes as needed.

This article is a part of 70-410 Installing and Configuring Windows Server 2012 Prep course, more articles in this course are :

Using AppLocker

Software restriction policies can be a powerful tool, but they can also require a great deal of administrative overhead. If ...
Read More

Understanding Windows Firewall settings

Windows Server 2012 R2 includes a firewall program called Windows Firewall, which is activated by default on all systems. In ...
Read More

Working with Windows Firewall

Windows Firewall is a single program with one set of rules, but there are two distinct interfaces you can use ...
Read More

Using Windows Firewall control panel applet

The Windows Firewall control panel applet provides the easiest and safest access to the firewall controls. These controls are usually ...
Read More

Windows Firewall With Advanced Security console

Using Windows Firewall With Advanced Security console The Windows Firewall control panel is designed to enable administrators and advanced users ...
Read More

70-410 Installing and Configuring Windows Server 2012 Prep course includes following practice tests:

No posts found.