Skip to main content

Posts

Showing posts with the label Windows Managment Framework

Serialize data with PowerShell

Currently I am working on a big new module. In this module, I need to persist data to disk and reprocess them at some point even if the module/PowerShell session was closed. I needed to serialize objects and save them to disk. It needed to be very efficient to be able to support a high volume of objects. Hence I decided to turn this serializer into a module called HashData. Other Serializing methods In PowerShell we have several possibilities to serialize objects. There are two cmdlets you can use which are built in: Export-CliXml ConvertTo-JSON Both are excellent options if you do not care about the size of the file. In my case I needed something lean and mean in terms of the size on disk for the serialized object. Lets do some tests to compare the different types: (Hashdata.Object.ps1) You might be curious why I do not use the Export-CliXML cmdlet and just use the [System.Management.Automation.PSSerializer]::Serialize static method. The static method will generate t...

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...

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...