Windows Management Framework (WMF) 5.1 contains PowerShell 5.1. By default Windows Server 2008 R2 SP1 runs the older PowerShell version 2. By downloading and installing WMF 5.1 to a Windows Server 2008 R2 system, we can upgrade it to PowerShell version 5.1.
This post is part of our Microsoft 70-744 Securing Windows Server 2016 exam study guide series. For more related posts and information check out our full 70-744 study guide.
Download WMF 5.1 to a Windows Server 2008 R2 system
This also works with Windows Server 2012 and 2012 R2. By default Windows Server 2016 already has PowerShell 5.0 installed, so this is not required there. Note that to upgrade Windows Server 2008 R2 you must be using Service Pack 1 (SP1).
First we’ll confirm the verison of PowerShell on our 2008 R2 system. This can be done by opening PowerShell, and running $PSVersionTable, as shown below.
PS C:\> $PSVersionTable Name Value ---- ----- CLRVersion 2.0.50727.4927 BuildVersion 6.1.7600.16385 PSVersion 2.0 WSManStackVersion 2.0 PSCompatibleVersions {1.0, 2.0} SerializationVersion 1.1.0.1 PSRemotingProtocolVersion 2.1
As expected we have PowerShell version 2.0, which is the default in this operating system.
WMF 5.0 or higher is needed to provide the just-enough administration (JEA) PowerShell feature implemented in Windows Server 2016 into the older 2008 R2 SP1 operating system.
Before we download and install WMF though, we must first install .NET Framework 4.5.2 or later, as this is a prerequisite for WMF 5.1 in Windows Server 2008 R2 SP1, and by default 2008 R2 SP1 comes with .NET 3.5. You can download a newer version of .NET from here: https://www.microsoft.com/net/download/framework
After installation has completed you’ll need to perform a system reboot to proceed.
Next download Windows Management Framework (WMF) 5.1 from Microsoft: https://www.microsoft.com/en-us/download/details.aspx?id=54616
A system reboot is not required after installing WMF.
Once installed open PowerShell and run $PSVersionTable again, we can now see that PSVersion is listed as 5.1 as expected.
PS C:\> $PSVersionTable Name Value ---- ----- PSVersion 5.1.14409.1005 PSEdition Desktop PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...} BuildVersion 10.0.14409.1005 CLRVersion 4.0.30319.42000 WSManStackVersion 3.0 PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1
We will now be able to configure our Windows Server 2008 R2 SP1 system to use just-enough administration (JEA), as we’ll cover in future posts.
Summary
By first updating the .NET Framework and then installing either WMF 5.0 or 5.1, we can upgrade our PowerShell version to support Just-Enough Administration (JEA) in older versions of Windows, such as Windows Server 2008 R2, 2012, and 2012 R2.
This post is part of our Microsoft 70-744 Securing Windows Server 2016 exam study guide series. For more related posts and information check out our full 70-744 study guide.
I had to reboot.
Same here
Thanks for the great info, very concise and well written
No problem at all, cheers!
It helped a lot. :)
Same here. Had to reboot. It didnt show new version….
Same here. Had to reboot. It didnt show new version….
Thanks for the great info!
It helped a lot.
I had to reboot after both installation but it works well.
Thanks a lot.
Dom