Module 5 - Implementing Desired State Configuration
Module 5 - Implementing Desired State Configuration
Modernization
Hands-On Lab | Step-by-Step Guide
Contents
Contents
CONTENTS ............................................................................................................................... 2
OVERVIEW................................................................................................................................ 3
OBJECTIVES ............................................................................................................................ 3
LAB 1: EXPLORING WINDOWS POWERSHELL DESIRE STATE CONFIGURATION ........... 4
EXERCISE 1.1: REVIEWING WINDOWS POWERSHELL DESIRED STATE
CONFIGURATION COMPONENTS........................................................................................... 4
EXERCISE 1.2: IMPLEMENTING BASIC DSC ......................................................................... 6
EXERCISE 1.2: IMPLEMENTING MORE DETAILED DSC ....................................................... 9
EXERCISE 1.3: IMPLEMENT REPEATABLE CONFIGURATION AND CHANGE CONTROL 11
EXERCISE 1.4: USING ONEGET TO INSTALL PACKAGES ................................................. 12
LAB 2: USING WINDOWS POWERSHELL DESIRED STATE CONFIGURATION FOR
SHAREPOINT ......................................................................................................................... 14
EXERCISE 2.1: IMPLEMENT REPEATABLE CONFIGURATION AND CHANGE CONTROL 14
Overview
In Lab 1, you will explore some of the new enhancements in management for Windows Server 2012 R2.
You will then explore a key new feature called Windows PowerShell Desired State Configuration (DSC).
This feature allows you provide standardization of services across server farms and server deployments
for specific roles within your organization. DSC makes use of different types of resources to extend the
type of server functionality validation.
In Lab 2, you will implement a pre-created configuration script to prepare a server to receive a
SharePoint 2013 installation. This exercise is an example of how DSC scripts can be created and
distributed to simplify the process of server installation.
Estimated time to complete this module
60 minutes
Objectives
After completing this module, you will be able to:
To perform the exercises for this module you must first launch the lab environment called IM203A
Desired State Configuration Environment. The computers included in the environment are listed in the
following table.
Virtual Machine
Role
DC
Admin
Server1
Purpose
Archive
Registry
Script
Package
Environment
Group
User
Service
Manage services
File
Log
Process
Configure processes
Role
3. In the New Remote PowerShell Tab window, in computer, type Server1, and then in the User
name, type Administrator, and then click Connect.
10. In Windows PowerShell ISE, type the following command, and then press ENTER.
Get-Service Name W3SVC ComputerName Server1
This will verify that the web server and website are now running,
4. In Windows PowerShell ISE, type the following command, and then press ENTER.
Start-DSCConfiguration ComputerName Server1 Path IISWebSite Wait Verbose
5. In Internet Explorer, refresh the website Server1.
10
4. In Windows PowerShell ISE, type the following command, and then press ENTER.
Start-DSCConfiguration ComputerName Server1 Path IISWebSite Wait Verbose
5. In Internet Explorer, refresh the website Server1.
11
Virtual Machine
Role
AzureITC-DC
AzureITC-Admin
AzureITC-Edge
Find-Package sysinternals
12
Close and discard the lab environment. You will return to the IM203A Desired State Configuration
Environment for the next exercise.
13
You may observe that the Media Foundation has been marked as commented, causing it to be
skipped. Media Foundation requires a system restart so it was omitted from this configuration run
simply to expedite the configuration processing.
If you open a new Windows PowerShell ISE console, ensure that you connect to Server1 using the
New Remote PowerShell tab from the File menu.
14
3. In Windows PowerShell ISE, type the following command, and then press ENTER.
Start-DSCConfiguration ComputerName Server1 Path SharePointPrereq Wait Verbose
This command may take up to 15 minutes to complete.
4. In Windows PowerShell ISE, type the following command, and then press ENTER.
Get-ItemProperty Path HKLM:\SYSTEM\CurrentControlSet\Control\LSA
-Name DisableLoopbackCheck
The value and entry for DisableLoopbackCheck is presented.
5. In Windows PowerShell ISE, type the following command, and then press ENTER.
Remove-ItemProperty Path HKLM:\SYSTEM\CurrentControlSet\Control\LSA
-Name DisableLoopbackCheck
The registry key is removed.
6. In Windows PowerShell ISE, type the following command, and then press ENTER:
Get-ItemProperty Path HKLM:\SYSTEM\CurrentControlSet\Control\LSA
-Name DisableLoopbackCheck
15
16