Desired State Configuration


Video: Recreate MOF based DSC resources as Class based DSC resources

Last month I presented a session on how to Recreate MOF based DSC resources as Class based DSC resources at the PowerShell + DevOps Global Summit in Seattle, Washington. The session seemed to be well received by the audience based on the feedback that I received from the attendees. The video from this presentation is now available. The code and slides used during the demonstration can be found in my presentations repository on GitHub.

Create a Certificate to Encrypt MOF Passwords that’s Compatible with DSC in PowerShell version 5.0

I’ve previously written a blog article titled “Use a certificate with PowerShell DSC to add a server to Active Directory without hard coding a password” where I had created a certificate that was used to encrypt the password in a PowerShell version 4 DSC (Desired State Configuration) MOF file. The same procedure in PowerShell v5 generates an error stating the certificate cannot be used for encryption: ConvertTo-MOFInstance : System.ArgumentException error processing property ‘Password’ OF TYPE ‘MSFT_Credential’:Certificate ‘6EBFB5C88AB4B8C9E3B8E30E88A5D071D6735464’ cannot be used for encryption.

Simplifying my PowerShell version 5 Class Based DSC Resource for Configuring Remote Desktop

Last week I wrote a blog article about a PowerShell Desired State Configuration Class Based Resource for Configuring Remote Desktop. Since then I’ve discovered and learned a couple of new things about enumerations in PowerShell that can be used to simply the code even further. My original code used a couple of enumerations which I’ve removed to show how they can be used to further simply the code: class RemoteDesktop { [DscProperty(Key)] [string]$UserAuthenication [DscProperty(Mandatory)] [string]$Ensure [RemoteDesktop]Get() { $this.

PowerShell Desired State Configuration Class Based Resource for Configuring Remote Desktop

Prior to PowerShell version 5 being released, I had written a PowerShell version 4 compatible DSC (Desired State Configuration) resource named cMrRDP for configuring Remote Desktop. It can be found in my DSC respository on GitHub. The recommendation at that point was to use the letter “c” as the prefix for community created DSC resources. The current recommendation is to no longer use the “c” prefix for DSC resources. Steven Murawski wrote a blog article titled DSC People - Let’s Stop Using ‘c’ Now that I recommend taking a look at.

Speaking on both PowerShell and DSC at SQL Saturday Baton Rouge 2016 this Weekend!

Although PowerShell has been around for 10 years now, there are still some who are just getting started with it. There are several categories that new comers fit into, some are just starting out in their career, others may be career changers, and others may have been in the industry for a number of years and are finally trying to embrace PowerShell. Regardless of which category you fit into, I’ll be presenting a session on “PowerShell Fundamentals for the Absolute Beginner” at SQL Saturday #515 in Baton Rougethis Saturday, August 6th.

Video: Creating a Custom PowerShell Toolkit to Demystify DSC

Last week, on Monday (April 4th, 2016), I presented a session at the PowerShell and DevOps Global Summit 2016 on “Creating a Custom PowerShell Toolkit to Demystify the Intricacies of Desired State Configuration”. The video from that presentation is now available: Here’s the abstract or synopsis for this presentation: “DSC (Desired State Configuration) can be very complicated when working in an environment where nodes are set to retrieve their configuration from a pull server.

Solving DSC Problems on Windows 10 & Writing PowerShell Code that writes PowerShell Code for you

I recently ran into a problem with DSC on Windows 10 when trying to create MOF files with DSC configurations that work on other operating systems. An error is generated when the friendly name for a DSC resource contains a dash and that friendly name is specified as a dependency for another resource. I know that only certain characters are allowed in the name that’s specified for DependsOn and I’ve run into similar problems with things such as IP addresses due to the dot or period, but the dash works in other operating systems at least with the production preview of PowerShell version 5, but not with the version of PowerShell version 5 that ships with Windows 10:

Code and Slides from my sessions at SQL Saturday 439

Today I presented two wildly successful sessions at SQL Saturday #439 in Columbus, GA. The code and slides from my “How do I Get-Started with PowerShell?” session can be downloaded here and the code and slides from my “PS C:> Get-Started -With PowerShell Desired State Configuration” session can be downloaded here. The custom functions that are referenced in the code from the DSC session can be downloaded as part of my MrDSC modulefrom GitHub.

Video from Atlanta TechStravaganza 2015: Using PowerShell Desired State Configuration in your On-Premises Datacenter

This past Friday, I presented a session titled “Using PowerShell Desired State Configuration in your On-Premises Datacenter” at Atlanta TechStravaganza 2015. Fellow PowerShell MVP Stephen Owentook this photo as I was preparing for my session: Another fellow PowerShell MVP, Jonathan Walzof the PowerScripting Podcast, recorded all of the sessions in the PowerShell track which can be found on their YouTube channel. Several presentations are included in each of the videos and mine is approximately the first 43 minutes of this video:

DSC session at Atlanta TechStravaganza one week from today!

Have you seen the awesome lineup of speakers and sessions for Atlanta TechStravaganzathis year? Mark Minasiis the keynote speaker and there’s an all day dedicated PowerShell trackwhere Ed (The Scripting Guy) Wilsonwill be presenting along with several PowerShell MVP’s including Stephen Owen, and me (of course). My presentation is on “Using PowerShell Desired State Configuration in your On-Premises Datacenter” and I’ll share the initial slide of my slide deck that I created exclusively for my presentation at that event:

Presentation Materials from my sessions at SQL Saturday 423 in Baton Rouge

This past Saturday, I presented two sessions at SQL Saturday #423 in Baton Rouge. ](/images/2013/07/sqlsatbr.jpgsqlsatbr)The code and slides that I used during my “PS C:> Get-Started -With ‘PowerShell for SQL Server’” presentation can be downloaded from hereand the code and slides from my “PS C:> Get-Started -With ‘PowerShell Desired State Configuration’” presentation can be downloaded from here. The code from both sessions reference PowerShell functions that are part of script modules that can be downloaded from my SQL and DSC repositories on GitHub.

Presentation Materials from my Desired State Configuration Session at SQL Saturday 392 in Atlanta

This past Saturday, I presented a session titled “PS C:> Get-Started -With ‘PowerShell Desired State Configuration’” at SQL Saturday #392 in Atlanta. The code and slides that I used during the presentation can be downloaded from here. Some of the functions used in the downloadable code are part of my DSC toolkit module that can be downloaded from GitHub. Keep in mind that module is a work in progress. Here’s a list of the items from the “Resources” slide that was shown towards the end of my presentation that I recommended in case you’re interested in learning more about DSC:

Deploy Desired State Configuration Resources with an SMB based Pull Server

So you’ve either downloaded DSC resources from GitHubor you’ve created some DSC resources of your own and the LCM (Local Configuration Manager) on the servers in your environment is set to use an SMB based DSC pull server. To automatically deploy those custom resources with an SMB pull server, they need to be zipped up including their base directory and named “ResourceName_Version.zip”. For example, the xSmbShare DSC resource that can be download from GitHub would be named “xSmbShare_1.

Create a DSC SMB Pull Server with DSC and separate the Environmental Config from the Structural Config

On Saturday May 16th, I’ll be presenting a session titled “PS C:> Get-Started -With ‘PowerShell Desired State Configuration’” at SQL Saturday #392 in Atlanta. One of the things I’ll be demonstrating is a SMB based DSC Pull Server and I figured since it’s a DSC presentation, why not create it with DSC, right? The machines used in this blog article are running Windows 8.1 and Windows Server 2012 R2. Both have the default version of PowerShell installed that shipped with those operating systems which is PowerShell version 4.

Automatically create a checksum and publish DSC MOF configuration files to an SMB pull server

You’ve configured one or more DSC (Desired State Configuration) SMB pull servers in your environment. You’ve also configured the target nodes appropriately. One problem that seems to be a constant problem in your environment when authoring and updating DSC configuration files (MOF files) is keeping track of what GUID belongs to which machine and it’s also a common problem to forget to update the corresponding checksum when a configuration file is updated.

Using PowerShell Desired State Configuration to build the first domain controller in your Active Directory forest

If you’re a frequent reader of the blog articles on this site, then you know that I’ve been working on using Desired State Configuration to build my test lab environment that runs as Hyper-V VM’s on my Windows 8.1 computer. If you would like to know the current state of my test environment, see the previous blog article: “Creating a Desired State Configuration Resource for Self Signed Certificates”. The certificate created in last week’s blog has been exported and copied to the Windows 8.

Creating a Desired State Configuration Resource for Self Signed Certificates

For those of you who follow my blog, you know that I’ve been working on using DSC (Desired State Configuration) to fully automate the build of my test environment that runs as Hyper-V VM’s on my Windows 8.1 computer. Last week in my blog article titled “Automate the installation of DSC Resource Kit Wave 9 resources with PowerShell Desired State Configuration”, I demonstrated how to do just that, automate the installation of the Microsoft created DSC resources that are part of the most recent DSC resource kit (wave 9).

Automate the installation of DSC Resource Kit Wave 9 resources with PowerShell Desired State Configuration

Last week, in my blog article titled Creating Hyper-V VM’s with Desired State Configuration I left off with a newly created Hyper-V VM named Test01 that was created with DSC and the specific IP address of that VM was added to my trusted host list. For more details on the current state of this test environment, see that previous blog article. Today I’ll begin configuring the Test01 VM with DSC. This virtual machine will become the first Active Directory domain controller in my test environment.

Creating Hyper-V VM’s with Desired State Configuration

I’m looking to automate the build of my test environment that runs as Hyper-V virtual machines on my Windows 8.1 Laptop computer. To get started, I thought I would take a look at the xHyper-V DSC resource to create the actual VM’s. There’s also no reason this shouldn’t work on a Windows Server that’s running the Hyper-V role. The Hyper-V role has already been added to my Windows 8.1 computer. I also have a previously created virtual hard drive (vhdx) file that has been loaded with the Windows Server 2012 R2 operating system and all of the available Windows updates.

Use a certificate with PowerShell DSC to add a server to Active Directory without hard coding a password

A new Windows Server 2012 R2 machine has been brought online and needs to be joined to your Active Directory domain. All machines used in this demonstration are running either Windows Server 2012 R2 or Windows 8.1 with PowerShell version 4. You’ve decided to use DSC (Desired State Configuration) to join this new server to the domain because it’s a prototype for many more servers to come. You plan to automate their deployment along with the majority of their configuration with DSC.

PowerShell Desired State Configuration Error: Undefined Property ConfigurationName

The scenario in this blog article is that you’ve created a DSC configuration on a computer that’s running a preview of PowerShell version 5. The machine itself could be running Windows 8.1, Server 2012 R2, or the Windows Technical Preview version of Windows 10. Here’s a simple configuration that I’ll use to demonstrate the problem. This DSC configuration uses a custom DSC resource to rename a computer. This configuration is being created on a machine running the Windows Technical Preview version of Windows 10 with PowerShell version 5 build 9860 (the most recent build as of this writing).

PowerShell Version 5 New Feature: New Parameters added to the New-DscCheckSum and Test-DscConfiguration Cmdlets

I’m continuing on my series of blog articles on the new features in the preview version of PowerShell version 5. Today I’ll be discussing the existing DSC (Desired State Configuration) cmdlets in PowerShell version 4 that now have new parameters as of the May 2014 preview version of PowerShell version 5. To begin, I’ll define a DSC configuration that’s parameterized so that it’s reusable: configuration iSCSI { param ( [Parameter(Mandatory)] [string[]]$ComputerName ) node $ComputerName { WindowsFeature MultipathIO { Name = 'Multipath-IO' Ensure = 'Present' } Service iSCSIService { Name = 'MSiSCSI' StartupType = 'Automatic' State = 'Running' } } } Run the configuration specifying the computer names to create MOF files for:

Using PowerShell Desired State Configuration to Unzip Files

A couple of months ago I wrote a blog about a “PowerShell Function to Unzip Files Using the .NET Framework 4.5 with Fallback to COM”. I’ve since discovered that the new Desired State Configuration (DSC) feature in PowerShell version 4 can unzip files. You probably wouldn’t use this feature just to unzip a single file to a single server, but it does open up some interesting possibilities. This blog article is not meant to be an all inclusive tutorial on DSC, it’s only meant to give you a peek inside the built-in DSC Archive Resource capabilities.