My Profile Photo

duffney.io


DevOps Engineer | Pluralsight Author | Speaker | Blogger | PowerShell Advocate


  1. Windows Event Forwarding for Active Directory Security Logs with DSC

    In this post, I will be teaching you how to configure Windows Event Logs Forwarding for Active Directory Security Logs that are stored on Domain Controllers. This is a real world example of how to use DSC in your environments and showcases the benefits of using DSC. If you are not currently using some logging system, I highly encourage you take the lessons learned here and use them to build a simple logging solution. In...…


  2. Creating Lab Environments with LabBuilder

    Applies to: Windows PowerShell 5.0, Hyper-V Stop testing in production! You’ve been hearing that for a while now, and so had I. However, I continued to do it. Mainly in part because I was too lazy to setup the required infrastructure to simulate my production environments. Let’s face it, most of us won’t be able to mirror our production environments. Given the choice I’d nuke my production environments and start over. Accepting the fact that...…


  3. Create Scheduled Tasks with Secure Passwords

    Applies to: Windows PowerShell 3.0,4.0,5.0 While writing the DSC configuration for some Jenkins slaves, I discovered the Register-ScheduledTask cmdlet only accepts string variables. This forced me to store my service account password as clear text, which made me cringe. I knew there had to be a better way, even if the cmdlet did not allow a credential object to be passed to it. In this post you’ll learn how to extract the password from a...…


  4. CovertTo MofInstance Certificate Cannot be used for Encryption

    Applies to: Windows PowerShell 5.0 You probably ran into this error while using a Windows 10 or Windows Server 2016 Technical Preview when attempting to encrypt DSC configuratiosn, as I did. For some reason, the certificates I had been using no loneger worked. When I attempted to ecnrypt my DSC configurations I got the above error saying the the function ConvertTo-MofInstance failed and that the certificate that I was using could not be used for...…


  5. Configuring an HTTPS Pull Server for Desired State Configuration

    Applies to: Windows PowerShell 4.0, Windows PowerShell 5.0 This blog post will guide you through the process of setting up and configuring an HTTPS Pull Server to deploy Desired State Configurations to nodes. It will also walk you through the process of requesting the cert from the CA (Certificate Authority)! That is the main reason I’m taking the time to write the post, almost all the DSC training I’ve watched skips that step and leaves...…


  6. Encrypting Credentials with DSC Configurations

    Applies to: Windows PowerShell 4.0, Windows PowerShell 5.0 In this blog post we’ll be covering how to encrypt credentials stored in Desired State Configuration (DSC) .mof files. This is a secure alternative to secure plain text passwords in the .mof files. Before we begin I’m assuming a few things, such as an existing Active Directory domain environment and a PKI (Public Key Infrastructure) has been setup. Below is a summarized list of things you need...…


  7. Build Active Directory Certificate Services with DSC

    Applies to: Windows PowerShell 5.0, Windows Server 2012r2+ Today we will be standing up a Public Key Infrastructure (PKI) with Active Directory Certificate Services, but not the manual click click way. We’ll be applying a desired state configuration that will set it up for us! The end result will be a standalone PKI server, perfect for lab environments. This post won’t be to helpful if you’re looking to stand up a production ready PKI environment....…


  8. Setting up a Vyos Virtual Router in Hyper-V

    Applies to: Windows PowerShell 5.0, Windows 10, Windows Server 2016 In this post we’ll be walking through how to setup a Vyos virtual router for a Hyper-V lab. Vyos is an open source virtual router, which allows us to have a separate network for all of our Hyper-V virtual machines and route it’s traffic through our normal private network to the internet. We’ll keep it simple and have only two networks to worry about. One...…


  9. Get Software Icon from an .exe with PowerShell

    Applies to: Windows PowerShell 3.0+ There are a few software applications out there that can extract the .ico image from an executable. However, why would you download and install software for something PowerShell can do for you. This fucntion Get-Icon will do exactly what the name leads you to believe, which is getting a .ico file from a .exe file. It will also name the .ico the same name as the .exe, just with a...…


  10. Copying SQL Tables with PowerShell

    Applies to: Windows PowerShell 3.0, Windows PowerShell 4.0, Windows PowerShell 5.0, SQLCmdlets Module 1.0 When working with SQL there might be a time where you want to move all the data in a table to a new database. This process is simple with Standard and up versions of SQL because they provide a tool for you. If you are using SQL express however that tool doesn’t exist. In this blog post we’ll be walking through...…