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 services

Most Windows Server roles and many of the features include services, which are programs that run continuously in the background, ...
Read More

Delegating server administration

As networks grow, so does the number of administrative tasks there are to perform on a regular basis, and so ...
Read More

Using Windows PowerShell Desired State Configuration (DSC)

Desired State Configuration (DSC) is the next phase in the development of Windows Power-Shell, a process that began over a ...
Read More

Planning server storage

A Windows server can conceivably perform its tasks using the same type of storage as a workstation; that is, one ...
Read More

Windows disk settings

Windows Disk Settings Overview When you install Windows Server 2012 R2 on a computer, the setup program automatically performs all ...
Read More

Working with disks

Windows Server 2012 R2 includes tools that enable you to manage disks graphically or from the command prompt. All Windows ...
Read More

Creating folder shares

Sharing folders makes them accessible to network users. After you have configured the disks on a file server, you must ...
Read More

Assigning permissions

Using Windows Server 2012 R2, you can control access to a file server to provide network users the access they ...
Read More

Configuring Volume Shadow Copies

Volume Shadow Copies is a Windows Server 2012 R2 feature that enables you to maintain previous versions of files on ...
Read More

Configuring NTFS quotas

Managing disk space is a constant concern for server administrators, and one way to prevent users from monopolizing storage is ...
Read More

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

No posts found.