How to Install .Net Framework 3.5 on Server 2012 R2 with PowerShell

Recently, I noticed that installing .Net Framework on Server 2012 R2 is not very straightforward. When I got the below error I started looking around.

GUI Error

I found this blog, which does a beyond great job demonstrating utilizing the GUI. However, if you want to use PowerShell or don’t have a GUI (I don’t know if you can install .Net w/o a GUI though), I found the commands to do so.

In order to verify 100% that the service did not install when I tried with the GUI, I restart the computer, then ran:

Get-WindowsFeature -ComputerName VM *NET*

and got the following results.

Feature Install

Since the Role of “.Net Framework 3.5 Features” was not selected, nor were any of the features, the role has not be installed.

Following that, I installed the Windows Features and Role I needed using:

Install-WindowsFeature -ComputerName VM NET-Framework-Feature, NET-Framework-Core

This failed. If you notice from the below error, the installer cannot find the right files locally on the machine.
PS Error
So, in order to fix this, we have to insert the installation DVD (mount the ISO if virtual) and specify the path.

Install-WindowsFeature -ComputerName VM NET-Framework-Feature, NET-Framework-Core -Source D:\sources\sxs

This will allow the .Net Framework 3.5 to be installed. If you run:

Get-WindowsFeature -ComputerName VM *NET*

This will verify the needed .Net Framework 3.5 actually installed.

PS Successful

***UPDATE – you CAN install .Net Framework 3.5 on server core.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s