Skip to main content

Posts

Showing posts with the label DSC

Desired State Configuration - Consistency

Happy new year!  Ages since I blogged about DSC and found a little topic that might be something others also are wondering about. I reached out to Chris Hunt ( @ LogicalDiagram ) on twitter. If I understand him correctly, he was wondering about capturing the verbose stream during a system invoked (Consistency Scheduled task) check. DSC has a scheduled task called Consistency (full Task Schedule path is \Microsoft\Windows\Desired State Configuration) which launch every 30 minutes. This task does the equivalent of running the Start-DSCconfiguration cmdlet and making sure that the configuration does not drift from the desired state. Did this a long time ago, however I had forgotten how I could do it. The scheduled task As you already probably guessed, this is just a task that executes an powershell command using the cmdet Invoke-CIMmethod with some parameters: The task starts an hidden powershell window and executes the following command: I have copied the comman...

What is around the corner for IT-Pros – Part 2

This is part 2 of a multi post around topics discussed in Part1 . Next up is Hybrid Cloud and how it will impact us and why it is the way of the future. Hybrid cloud Microsoft changed their focus a couple of years ago, from the primary solution provider for enterprise software running in datacenters to a Mobile/Cloud first strategy. Their bet was that the cloud would be more important and that the economic growth would be created in the emerging cloud market. Needless to say that it looks like their bet is paying of tenfold. Azure Over the last year there have been a significant number of announcements that connect Azure to your datacenter, thus enabling enterprise to utilize cloud resources with enterprise On-Prem datasources or local hybrid runbook workers. It should not come as any surprise that this trend is accelerating in preparation for the next big shift in hybrid technology, that is expected to be released with Windows Server 2016 – Microsoft Azure Stack. Before we ...

How to undo an Powershell Desired State Configuration (DSC)

I saw a post on this on Stackexchange.com ( link ) asking about how you could undo/remove a configuration. I understand the question and logic behind it. I would love for DSC to have this functionally, however this is not how it works today. Perhaps some day in the future, however I would not bet on it. If you read this post, it will make perfect sense. The life of an Desired State Configuration (DSC) An configuration item/resource in DSC has to states it lives and cares about. Ensure equals PRESENT or ABSENT . The current state of the item and/or node (the target of the configuration) before the configuration is applied is not "stored" anywhere. It is just how the node is configured before the configuration is committed on the node. Furthermore any individual who has access to the node, may install/configure features that you are not aware of. That is of course if you do not create a configuration consisting of all possible combinations of a configuration state ...

Desired State Configuration - ConfigurationData

Update 12.10.2016 - More functions added to repro some while ago This module has been laying dormant in my BitBucket repro. Looks like people are realizing that DSC is about to become a thing. Need some feedback if this is a way of handling your Configuration data in DSC. I will publish it to the PowershellGallery if people find it useful. Should probably do a code review as well since this was written over 2 years ago :-0. Update 19.04.2014 - Module (beta) added to bitbucket here When you start to work with DSC, you quickly realize that separating the infrastructure from the configuration is a huge benefit and somewhat of a curse. You start to read blogs and webposts explaining how you can specify the configurationdata to you configuration, however for the people that does not speak powershell (yes they are out there) and/or still don’t like it, it looks kind of “untidy”. Example: Yes, Beelzebub has joined the party, pure evil. Just to explain ConfigurationData in Desired ...

Desired state configuration – xComputer domain join

Here we go again. This is just a short post on how to use the resource to join a computer to the domain. Steps we will perform: Download the resource from here . Follow the instructions to add it to the modules folder on you target computer. Create configuration data Build a very short configuration Here is the configuration data we will use: $ConfigData = @{ AllNodes = @( @{ NodeName = "*" PSDscAllowPlainTextPassword = $true } @{ NodeName = "localhost" } ); NonNodeData = @{           domainName = "try.local"       } } A few points to note here: We have a node called “*”. It is kind of a “wildcard”, however wildcards are not supported in DSC. All key/values you specify in this node, will get inherited by all nodes. That is why I do not need to specify the PSDscAllowPla...

Hybrid cloud – the missing automation link?

Fair warning: I am probably off on a rant here about the cloud and how “everything is connected” in terms of automation. This post is going to discuss the recent offensive from Microsoft and their vision about a Hybrid Cloud. I will not do a deep dive into any technical aspects, however do a more overall discussion about the vision and how recent changes brought to us by Windows Server 2012 R2 (and windows management framework 4) can affect us going forward. Background – What do we have and what has happened? From “nowhere” Azure as a PaaS was born. A while before that people started talking about “The Cloud” and things started to move about in terms of Public (The Cloud) and Private Cloud (“On-Premises or On-Prem as it is called nowadays) . Moving forward a bit Microsoft started to launch their vision about Hybrid Cloud, a nice mix of the “best” of the Public and Private cloud. This was even supported with the release of the System Center 2012 suite and together with Windows S...

Powershell – The DSC book

Don Jones (@concentrateddon) is writing this awesome book about DSC. Please help him review the contents and make suggestions. You may leave feedback on the Powershell.org/FAQ web page (just create a new post there). I have been working as an consultant in IT since 1999, I have done a lot of strange “things” (work related that is). I have done my fair share of vb-scripting and small GUIs or console application development using vb.net etc. I have even created an automation solution/"framework" with powershell and .net (.net Forms). I have been using powershell since exchange 2007, however the last 2 years I have been a “heavy” user writing advanced scripts/functions, dot-sourcing, creating small modules etc. Full disclosure; I am not exaggerating when I say I am super excited about DSC. My comments (in random order, when I say you/your I target Mr Jones, I think :-)) DSC resources – As you mention Microsoft has released 2 waves of additional resources for DSC. Wh...

More Powershell DSC resources released

  The PowerShell Blog has released information about the second wave of resources to use in your Desired State Configuration. Looks like the guys have been really busy  and released some neat resources for us. Here is the list: Resource Description Module Name Link xADDomain Create and manage an Active Directory Domain xActiveDirectory click here xADDomainController Create and manage an AD Domain Controller xActiveDirectory click here xADUser Create and manage an AD User xActiveDirectory click here xWaitForADDomain Pause configuration implementation until the AD Domain is available.  Used for cross machine synchronization. xActiveDirectory click here xSqlServerInstall Create and manage a SQL Server Installation. xSqlps click here xSqlHAService Create and manage a SQL High Availability Service. xSqlps click here xSqlHAEndpoint Create and manage the endpoint used to access a SQL High Availability Group. xSqlps ...

Powershell - Desired State Configuration (DSC) - Is it desired?

Finally found some time to play around with DSC on 2012 R2 and with the release of Windows Management Framework 4 , I can finally play with 2008 R2, Windows 7 and Windows 8 clients (if you upgrade to 8.1). As always with new releases of the Management Framework, some server configurations/applications do not play nicely with the new framework: System Center 2012 Configuration Manager ( not including SP1) System Center Virtual Machine Manager 2008 R2 (including SP1) Microsoft Exchange Server 2013 , Microsoft Exchange Server 2010 and Microsoft Exchange Server 2007 Microsoft SharePoint 2013 and M icrosoft SharePoint 2010 Windows Small Business Server 2011 Standard Please also note that .Net 4.5 is required before you install the Framework, otherwise the Framework installation will actually silently fail. As I previously wrote, if you were hoping for support for Windows Server 2008 support, you are not getting it. You will have to fall back to Windows Management Fram...