Videos and slides from Nordic Infrastructure Conference 2016

The Nordic Infrastructure Conference (NIC) conference was arranged in Oslo, Norway on Thursday 4th and Friday 5th of February 2016
Video recordings and slides from mine and Aleksandar Nikolic`s sessions is now available:

Title Video Slides Speakers
PowerShell Desired State Configuration – Real World Experiences Link Link Jan Egil Ring
Remote Management of Nano Server Link Link Aleksandar Nikolic & Jan Egil Ring

You can find recordings of all the other great sessions from the conference here.

Videos, slides and demos from PowerShell Summit Europe 2015

The PowerShell Summit Europe 2015 conference was arranged in Stockholm, Sweden on September 14-16.

I`ve written an article on PowerShell Magazine where I shared pictures and my experiences from the conference.

Video recordings, slides and demo-code (Git repositories) is from my sessions is available here:

Title Video Slides Demo-code
Manage your IT Pro computer using PowerShell Link Link Link
PowerShell Desired State Configuration – Real World Experiences Link Link Link

Speaking at PowerShell Summit Europe 2015

I will be presenting 2 sessions at PowerShell Summit Europe 2015. The conference will be in Stockholm (Kista), Sweden, on September 14-16.

Registration for PowerShell Summit Europe was opened on February 27th, 2015, you can read the announcement here.

 

figure_15-001

 

You will have the opportunity to meet many people from the PowerShell community at the conference, as well as members from the PowerShell team at Microsoft.

The topics for my sessions is OneGet/PowerShellGet and PowerShell Desired State Configuration:

image

 

image

 

Event information

 

Hope to see you at the conference!

Slides, demos and recording of my PowerShell DSC session at the Nordic Infrastructure Conference 2015

On January 24th – 25th the Nordic Infrastructure Conference (NIC) was arranged in Oslo, Norway for the second time.
The goal for the conference is creating a premier event for all IT-professionals in the Nordics, and like the previous editions of NIC, this edition was also a great success with a number of excellent speakers.

I presented a session called “The State of PowerShell Desired State Configuration”:

The first version of Desired State Configuration (DSC), a new management platform in Windows PowerShell that enables deploying and managing configurations,  was released in Windows PowerShell 4.0. In this session you will see how DSC has evolved since then, and what`s coming in the next version which will be released later this year.

You can find the recording of the session on YouTube, while slides and demos is available on  OneDrive.

Recordings of all other sessions from the conference is available here.

 

Other PowerShell related videos from the conference

Book review: Windows PowerShell Desired State Configuration Revealed

I recently finished reading Windows PowerShell Desired State Configuration Revealed by Windows PowerShell MVP Ravikanth Chaganti:

The book starts out with an introduction to Windows PowerShell, covering technologies relevant to DSC, such as PowerShell Remoting and CIM.
In the second part the fundamentals is introduced, before advanced DSC concepts and tricks is covered in the last part.

I have worked with DSC and held presentations on the subject since DSC was released in PowerShell 4.0, and I have learned a lot from the book which I havent seen or read about before (even in the product documentation).
For example, the details of how to configure a Web Pull Server was very useful. I
ve used the DSC Resource available in the DSC Resource Kit for configuring a Web Pull Server, and not looked at the details covered in the book.

A lot of other useful information is covered, such as how the DSC download managers uses the Get-DscAction, Get-DscDocument and Get-DscModule cmdlets (nice to know for troubleshooting purposes).

The CIM implementation for DSC is also described in details, for example how to use the available CIM methods to perform actions and apply configurations. This knowledge makes it easier to understand how the technology works under the hood.

The first version of DSC was released in PowerShell (Windows Management Framework) 4.0, and there is also some information about the next version, including bugs which has been fixed.

I highly recommend this book for anyone who wants to learn about PowerShell Desired State Configuration.

PowerShell DSC presentation for the Philadelphia PowerShell User Group

On September 4th 2014 I was invited to do a presentation for the Philadelphia PowerShell User Group.

The topic for my session was “Get Started with Windows PowerShell Desired State Configuration”, where I covered the following topics:

  • The background and goal of DSC
  • Configuration models
  • Configuring the Local Configuration Manager (demo)
  • Configuring a Pull Server using File Download Manager(demo)
  • Configuring a Pull Server using Web Download Manager(demo)
  • DSC Resources
  • DSC in Microsoft Azure(demo)
  • PowerShell DSC “V2” (demo featuring what is new in Windows Management Framework 5 based on the 2014 September Preview)
  • Related 3rd party products (Chef, Puppet and CFEngine)

A few hours before the meeting the Windows Management Framework 5.0 Preview September 2014 became available, so I prepared a virtual machine with the latest preview in order to give a quick tour of some of the enhancements in the upcoming version.

Resources available from the presentation:

Windows PowerShell DSC Resource Kit Community Edition

During the Christmas holiday the Windows PowerShell team published a holiday gift to the community: The Windows PowerShell Desired State Configuration Resource Kit.

The resource kit contains a module with 8 DSC Resources for managing domain membership, websites, Hyper-V VMs, VHDs, switches and so on. The resources is prefixed with “x” – where the “x” stands for experimental, meaning these resources are provided “as is” and are not supported through any Microsoft support program or service. It is also stated that anyone can adapt the resources, but it is suggested to rename them with your own naming convention like Contoso_cWebsite.

The DSC Resource Kit is now published on PowerShell.orgs DSC Repository on GitHub, where the “x” has been renamed to “c” (short for “community”):

Resource

Description

cComputer

Name a computer and add it to a domain/workgroup

cVHD

Create and managed VHDs

cVMHyperV

Create and manage a Hyper-V Virtual Machine

cVMSwitch

Create and manage a Hyper-V Virtual Switch

cDNSServerAddress

Bind a DNS Server address to one or more NIC

cIPAddress

Configure IPAddress (v4 and v6)

cDSCWebService

Configure DSC Service (aka Pull Server)

cWebsite

Deploy and configure a website on IIS

This means anyone in the community now can contribute with bug fixes or additional functionality.

 

Thanks to the PowerShell Team for shipping the DSC Resource Kit! Since the Resource Kit is named “DSC Resource Kit – Wave 1” its also likely to see more releases coming out.

Book recommendation: The Phoenix Project

I just finished reading The Phoenix Project: A Novel About IT, DevOps, and Helping Your Business Win:

 

The story is about Bill Palmer, an IT Manager at a company called Parts Unlimited. The company is considering outsourcing IT or splitting up the company, due to many failures in operations and projects. The competitors has launched new and innovative services, while Parts Unlimited stays behind and loses customers. The company initiates a new IT project code named The Phoenix Project in order to catch up with the market and save the company. During the book common scenarios in many IT departments everyday life is observed such as much firefighting and not being able to keep up with projects. As often before, internal IT projects which would have mitigated many of the problems is not prioritized. Getting more people is not an option according to the CEO, and would unlikely resolve the issues as we learn during the story. We learn how to think about IT, how cloud computing can be leveraged, as well as the importance of practices like ITIL and interdepartmental communications such as between developers and operations. Many times during the book I thought of how this relates to Windows PowerShell in terms of being able to automate manual repetitive work, as well as having consistent procedures for operations such as deployments. Specifically, technologies such as PowerShell Workflow and Desired State Configuration is coming to mind when Im thinking about how to solve many of the challenges.

I would highly recommend this book to anyone who will be working with IT in the coming years, it really is an eye-opener. No matter what your role in IT is, I think you will learn something which can help you and your business going forward.

 

Related links

Using the CIM Cmdlets in Windows PowerShell to solve a challenge

Introduced in PowerShell 3.0 and further enhanced in PowerShell 4.0, the CIM (Common Information Model) Cmdlets makes it easier to work with WMI (Windows Management Instrumentation). You can find an introduction to the new CIM Cmdlets in this article on the Windows PowerShell Teams blog.

In this article we will look at a usage scenario for the new CIM Cmdlets.

The Challenge

When adding a disk to a Windows Failover Cluster, the clustered disk is added to the cluster as a resource. The resource is automatically named “Cluster Disk N”, where N is the first available number. The challenge we are going to solve is renaming the newly added cluster disk based on the name (File System Label) of the underlying disk volume. This is typically an NTFS volume which is initialized and formatted before the disk is added to the cluster:

image

Using the Failover Cluster Manager in Windows Server we can view the name of the underlying volume:

image

Based on this observation we can manually rename the cluster resource. However, in a large cluster with many disks this task is a good candidate for automation.

Solving the challenge using CIM Cmdlets

By using the Get-ClusterResource cmdlet in the FailoverClusters PowerShell module we can view information about the disk, but there isnt an easy way to view the name of the underlying volume.

Due to that, we can rather leverage the Get-CimInstance cmdlet to list all cluster resources in the MSCluster_Resource class:

image

We use the –Filter parameter to specify that we only want cluster resources of the type “Physical Disk”, if not we would also get cluster resources such as cluster IP addresses, cluster names and so on.

Based on the information available on the object produced by Get-CimInstance, we can see many cluster related properties. However, no information about the underlying volume is available.

There is one cmdlet in the CIMCmdlets module which can get all the associated instances for a particular instance – the Get-CimAssociatedInstance cmdlet. In this scenario, we want to find all related volumes for the cluster disks. We start by finding all related instances:

image

This produced a large list of different kind of objects. We can use Get-Member to view information about the objects, and Select-Object to view the unique object types:

image

Based on the above output, the MSCluster_DiskPartition looks like a good candidate. We can use the –ResultClass parameter of Get-CimAssociatedInstance in order to narrow down the results to the class we want:

image

This is excactly what we want, as we can see the VolumeLabel property on the above output.

Now that we have the information we want – the VolumeLabel property – we need to find a way to rename the cluster resource (“Cluster Disk 1”). We can start by looking for a Rename method on the MSCluster_DiskPartition object. Normally, we would use Get-Member to view the available methods:

image

Since the CIM cmdlets is using the Ws-Man (WS-Management) protocol, the objects we get returned is serialized/deserialized. Thus the objects methods is remove since we arent working with a “live” object. The Get-CimClass cmdlet can be used to get the class schema of a CIM class, which includes the methods.
Instead let`s try the Get-CimClass cmdlet to view the methods available on the mscluster_resource class:

image

As we can see, there is a Rename method which takes one parameter: newName.

In order to invoke the method, we can use the Invoke-CimMethod cmdlet where we specify Rename as the MethodName and provide the value we want to configure as a hash table on the Arguments parameter:

image

We provided the VolumeLabel property returned by the Get-CimAssociatedInstance cmdlet as the value for the newName parameter, effectively solving the challenge.

After invoking the method, we can see the name of the cluster disk is immediately updated in Failover Cluster Manager:

image

When working with multiple cluster disks, we can use a foreach loop in order to invoke the rename method for all disks  if the name of the cluster resource does not match the name of the underlying disk volume:

Resources

How to install Windows PowerShell 4.0

Windows PowerShell 4.0 is part of the Windows Management Framework 4.0, which includes the following:

  • Windows PowerShell
  • Windows PowerShell Integrated Scripting Environment (ISE)
  • Windows PowerShell Web Services (Management OData IIS Extension)
  • Windows Remote Management (WinRM)
  • Windows Management Infrastructure (WMI)
  • Server Manager WMI provider
  • Windows PowerShell Desired State Configuration (DSC)

 

Windows Management Framework 4.0 supportability matrix

Operating system

Windows PowerShell 4.0 available

Prerequisites

Installation file

Windows Server 2012 R2

Built-in

N/A

N/A

Windows 8.1

Built-in

N/A

N/A

Windows Server 2012

Yes, part of WMF 4.0

.NET 4.5 (built-in)

x64: Windows8-RT-KB2799888-x64.msu

Windows 8

No, user must upgrade to Windows 8.1

N/A

N/A

Windows Server 2008 R2

Yes, part of WMF 4.0

Windows Server 2008 R2 SP1

.NET 4.5

x64: Windows6.1-KB2819745-x64-MultiPkg.msu

Windows 7

Yes, part of WMF 4.0

Windows 7 SP1

.NET 4.5

x64: Windows6.1-KB2819745-x64-MultiPkg.msu

x86: Windows6.1-KB2819745-x86.msu

 

Installation

  • Verify that all prerequisites is installed according to the Windows Management Framework 4.0 supportability matrix above. To verify the presence of .NET 4.5, you may use the Test-Net45 function available in this article on the Hey Scripting Guy! Blog
  • Run the installation file applicable to the operating system
  • Reboot the computer, start Windows PowerShell and verify that the output of $PSVersionTable shows 4.0 as the value of the PSVersion property

 

Known issues

 

1 – Installation succeeds even if .NET 4.5 is not installed

Scenario: Installing WMF 4.0 on a computer that is not running .NET Framework 4.5 will report that the installation is successful, but the components of WMF 4.0 (such as Windows PowerShell, WMI, etc.) will not be updated.

Solution: Install .NET Framework 4.5, and then run the WMF 4.0 installer again.

More information:
http://blogs.msdn.com/b/powershell/archive/2013/10/29/wmf-4-0-known-issue-partial-installation-without-net-framework-4-5.aspx

 

2 – Compatibility issues

There are known compatibility issues with several Microsoft server-class applications:

· 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 Server 2013 and Microsoft SharePoint Server 2010

· Windows Small Business Server 2011 Standard

Read the WMF 4.0 Release Notes for more information.

 

Related KB articles

 

This article is also posted on the Microsoft TechNet Wiki. If you have corrections or additional information, please update the Wiki-article.