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 :

Configuring Work Folders

Work Folders is a Windows Server 2012 R2 feature that enables administrators to provide their users with synchronized access to ...
Read More

Deploying print server

Installing, sharing, monitoring, and managing a single network print device is relatively simple, but when you are responsible for dozens ...
Read More

Sharing printer

Using Windows Server 2012 R2 as a print server can be simple or complex, depending on how many clients the ...
Read More

Managing documents in print queue

Managing documents refers to pausing, resuming, restarting, and canceling documents that are currently waiting in a print queue. By default, ...
Read More

Managing printers

Users with the Allow Manage This Printer permission can go beyond manipulating queued documents; they can reconfigure the printer itself ...
Read More

Using Print and Document Services role

All the printer sharing and management capabilities discussed in the previous sections are available on any Windows Server 2012 R2 ...
Read More

Using Server Manager for remote management

Server Manager has been the primary server administration tool for Windows Server ever since Windows Server 2003. The most obvious ...
Read More

Using Remote Server Administration Tools

You can manage remote servers from any computer running Windows Server 2012 R2; all the required tools are installed by ...
Read More

Working with remote servers

Once you have added remote servers to Server Manager, you can access them using a variety of remote administration tools ...
Read More

Virtualization architectures

Virtualization products can use several different architectures to share a computer’s hardware resources among VMs. The earlier type of virtualization ...
Read More

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

No posts found.