The DSC Book
Donald W. Jones and Melissa Januszko
  • March 2019
  • ISBN 9781617296352
  • 184 pages
The DSC Book teaches you everything you need to know to implement DSC today! You’ll learn DSC’s basic architecture, how to write configurations, and how to author your own DSC resources.

Distributed by Manning Publications

This book was created independently by Don Jones and Missy Januszko, both Microsoft MVPs and DSC experts, and is distributed by Manning Publications.

About the Technology

Desired State Configuration (DSC) makes it a breeze to maintain consistent configurations across servers by separating the desired configuration from the details of its implementation. A PowerShell-based cross-platform technology, DSC’s automatic configuration maintenance saves time and money, making DSC skills a hot commodity!

About the book

The DSC Book teaches you everything you need to know to implement DSC today! You’ll learn DSC’s basic architecture, how to write configurations, and how to author your own DSC resources. In their friendly style, the authors also explain advanced topics including reporting, security, and self-modifying configurations. Concise, real-world examples help your new skills stick!
Table of Contents detailed table of contents

Part 1: Design Decisions

1. Designing DSC

1.1. The Players

1.2. The Pieces

1.3. The CIM Connection

1.4. Uniqueness in MOFs

1.5. Getting the MOF to the LCM

1.6. Configuration Variations

1.6.1. One MOF, Many Nodes

1.6.2. Configuration Data Blocks

1.6.3. Simple Includes

1.6.4. Composite Configurations

1.6.5. Partial Configurations

1.6.6. The Choice of Not Choosing

1.6.7. What’s the Best Practice?

1.7. Understanding Dependencies

Part 2: Configuring the Infrastructure

2. Infrastructure Prerequisites

3. Configuring the LCM

3.1. Checking the Configuration

3.1.1. ActionAfterReboot

3.1.2. AllowModuleOverWrite

3.1.3. CertificateID

3.1.4. ConfigurationDownloadManagers

3.1.5. ConfigurationID

3.1.6. ConfigurationMode

3.1.7. ConfigurationModeFrequencyMins

3.1.8. Credential

3.1.9. DebugMode

3.1.10. DownloadManagerCustomData

3.1.11. DownloadManagerName

3.1.12. LCMCompatibleVersions

3.1.13. LCMState

3.1.14. LCMStateDetail

3.1.15. LCMVersion

3.1.16. StatusRetentionTimeInDays

3.1.17. PartialConfigurations

3.1.18. RebootNodeIfNeeded

3.1.19. RefreshFrequencyMins

3.1.20. RefreshMode

3.1.21. ReportManagers

3.1.22. ResourceModuleManagers

3.2. Changing the Configuration

3.3. Deploying the LCM Configuration

3.4. Specifying Configuration Pull Servers

3.5. Specifying DSC Resource Pull Servers

3.6. Specifying Reporting Servers

3.7. Partial Configurations

3.8. Versions and Troubleshooting

4. Setting Up a Pull Server

4.1. Before You Begin

4.2. Reprising the Roles

4.3. A Word of Caution

4.4. Step 1: Install the Module

4.5. Step 2: Get an SSL Certificate

4.6. Step 3: Make a GUID

4.7. Step 4: Set Up DSC

4.8. Step 5: Run and Deploy the Config

4.9. Confirming the Setup

4.10. Life Choices

5. Opting Out of the Pull Server Approach

Part 3: Testing the Infrastructure

6. Testing Push Mode

6.1. Creating the Configuration

6.2. Running the Configuration to Produce a MOF

6.3. Pushing the MOF

7. Testing Pull Mode

7.1. Creating the Configuration

7.2. Running the Configuration to Produce a MOF

7.3. Deploying the MOF and Module to a Pull Server

7.4. Creating a Meta-Configuration

7.5. Pushing the Meta-Configuration to a Node

7.6. Pulling the Configuration from the Pull Server

7.7. Verifying the Node’s State

Part 4: Authoring Configurations

8. Basic Configuration Authoring

8.1. Getting Started: The Configuration Block

8.2. Adding Nodes

8.3. Adding a Parameter Block

8.4. Adding Settings

8.5. Adding Basic Logic

8.6. Adding Node-Side Logic

8.7. Documenting Dependencies

8.8. Running the Configuration

8.9. Deploying the MOF

8.10. Wrapping Up

9. Going Further with Configurations

9.1. Again: DSC isn’t Tooling

9.2. Understanding ConfigurationData

9.3. Defining Configuration Data

9.4. Referencing and Using Configuration Data

9.5. All-Nodes Data

9.6. Using the $AllNodes Variable

9.7. Configuration Script Strategies

9.7.1. Option 1: Multiple Configuration Scripts

9.7.2. Option 2: Multiple Node{} Blocks

9.7.3. Option 3: Lots of Logic

9.8. Using NonNodeData

10. Poor Man’s Configuration Modularization

10.1. Dot Sourcing

10.2. Approach Analysis

11. Composite Configurations

11.1. Creating a Composite Resource

11.2. Turning the Configuration into a Resource Module

11.3. Using the Composite Resource

11.4. Deploying the Composite Resource

11.5. Approach Analysis

11.6. Design Considerations

12. Partial Configurations

12.1. Summarizing Partial Configuration Pros and Cons

12.2. Authoring a Partial Configuration MOF

12.3. Configuring the LCM for Partial Configurations

12.4. Partial Configuration Dependencies

12.5. Partial Configuration Authoritative Resources

12.6. Mix ‘n’ Match

12.7. File Naming Details

13. Deploying MOFs to a Pull Server

Part 5: Using and Authoring Resources

14. Finding and Using Resources

14.1. Finding What’s Out There

14.2. Installing What’s Out There

14.3. Finding What’s Installed

14.4. Figuring Out What a Resource Wants

15. Custom Resources

15.1. Before We Begin: Function-Based vs. Class-Based

15.2. Writing the Functional Code

15.3. Writing the Interface Module

15.4. Preparing the Module for Use and Deployment

15.5. Triggering a Reboot

16. Class-Based Custom Resources

16.1. Writing the Class-Based Interface Module

16.2. Preparing the Module for Use

17. Best Practices for Resource Design

17.1. Principle One: Resources are an Interface

17.2. Thinking About Design

17.3. For Example

17.4. Advantages of the Approach

17.5. Disadvantage of the Approach

18. The Script Resource

18.1. The Basics

18.2. Cool Tricks

Part 6: Advanced Stuff

19. Reporting

19.1. Understanding the Default Report Server

19.2. Querying Report Data

19.3. The AgentId

20. Security and DSC

20.1. A Word on Certificates

20.2. Securing the Pull Server

20.3. Securing Credentials in Configurations

20.3.1. You Need a Certificate

20.3.2. Verify the Certificate

20.3.3. Defining a Configuration Data Block

20.3.4. The Configuration Script

20.3.5. Sharing Certificates

20.3.6. Certificate Management

20.4. PSDSCRunAsCredential

20.5. Digital Signing

21. DSC in Azure

22. DSC on Linux

23. Troubleshooting and Debugging

23.1. Getting Eyes-On

23.1.1. Interactive Push

23.1.2. Get the Failing Node’s Configuration

23.1.3. Check the Logs

23.1.4. Stop Resource Module Caching

23.1.5. Check the Report Server

23.2. Resource Debugging

23.3. Stopping a Hung LCM

24. Self-Modifying Configurations

24.1. Understanding the LCM’s Processing

24.2. The Basic Self-Modifying Workflow

24.3. Options

24.4. A Problem to Consider

24.5. Crazy Ideas for What the Bootstrap Can Do

25. The Scaling Question

25.1. DSC Already Scales - But You Don’t

25.1.1. Answer 1: Tooling

25.1.2. Answer 2: Your Brain

25.2. Let’s Set the Stage

25.3. Raise Cattle, Not Pets

25.4. Enter Containers

25.5. Rock-Solid Infrastructure

25.6. Getting Back to DSC

25.7. The Perfect Example

26. LCM and Pull Server Communications

26.1. Node Registration

26.2. Node Check-In

26.3. Requesting a Configuration

26.4. Requesting a Module

26.5. Reporting

26.6. The Database

27. Known Problems

27.1. Error configuring the LCM: “Specified Property does not exist,” “MI RESULT 12”

27.2. Registration Key Problems

27.3. maxEnvelopeSize Errors

27.4. Reporting Server and Large Configurations

27.5. Class-Based Resources Can’t be ExclusiveResources in Partials

What's inside

  • DSC design principles
  • Authoring DSC resources
  • DSC in Azure and on Linux
  • Configuring the Local Configuration Manager (LCM)
  • Troubleshooting and debugging

About the reader

For IT administrators experienced in coding advanced PowerShell functions.

About the authors

Don Jones is the president, CEO, and cofounder of The DevOps Collective, and a curriculum designer for He’s written dozens of books on information technology. Missy Januszko is an IT consultant with more than 20 years of experience specializing in DevOps, automation, configuration management, PowerShell, and Active Directory.

placing your order...

Don't refresh or navigate away from the page.
eBook $24.99 $59.99 3 formats
The DSC Book (eBook) added to cart
continue shopping
go to cart

Prices displayed in rupees will be charged in USD when you check out.

FREE domestic shipping on three or more pBooks