EPIC SAVES

On Removing .Net 4.5 from a Windows Server…

Posted on Updated on

I had an occasion where all things pointed to .NET 4.5 being corrupted and needed to be reinstalled. In my case, MMC kept crashing on me no matter what I did.

If you remove .NET 4.5 from your server, after the requisite restart, you’ll be presented with a handy little thing called a Command Window…aaaaaaaand nothing else. So crack your knuckles and get ready to do some typin’ ladies & gents…

CommandWindow

The only way to get the GUI back and Powershell, for that matter, is to run the following DISM commands from the handy Command Window.

DISM being the Deployment Image Servicing and Management tool.

With thanks to Sanup Kumar Bishla in his LinkedIn article p

Type the following two commands and wait for the completion of each…then type in the third and final command to force a restart; When you come back up, you’ll need to invoke a few PowerShell commands before you have your GUI back!

  • DISM.exe /Online /enable-feature /featurename:NetFx4 /all
  • DISM.exe /online /enable-feature /featurename:MicrosoftWindowsPowerShell /all
  • shutdown /r

…now that you’re back… Press CNTL-ALT-DEL and bring up the Task Manager.

NOTE: If you’re RDP’ing into the server, type CNTL-ALT-END instead.

  • Once Task Manager Opens select File and Run new task
  • You should now see the Create new task menu, type PowerShell.exe and select OK
    • NOTE: PowerShell prompt should now be open
  • Run the following commands in PowerShell:
    • Install-WindowsFeature Server-Gui-Shell (this one took a while to complete for me!)
    • Install-WindowsFeature Server-Gui-Mgmt-Infra
  • Once the GUI Shell is installed, you will need to restart the server with the following command:
    • Restart-Computer

…when it comes up you should be back in business. This should convey the lesson that it really helps being familiar with the Command Line Interface (CLI) and PowerShell especially. It can pull your ass out of some serious situations, for sure!

A GUI-Only SysAdmin isn’t really a SysAdmin, IMHO.

I hope this helps you out!

B

Advertisements