This will be on the test for sure and it is good to know if you work with virtualized headless servers and get lost without the Gui or need to remove the Gui to harden the server.
Full to MinShell
Import-Module ServerManager
Uninstall-WindowsFeature Server-Gui-Shell -Restart
MinShell to Server Core
Import-Module ServerManager
Uninstall-Windowsfeature Server-Gui-Mgmt-Infra -Restart
Server Core to MinShell *Server2012R2.ISO mounted on Drive D: in this example
start powershell
Import-Module ServerManager
Install-Windowsfeature Server-Gui-Mgmt-Infra -Restart -Source wim:D:\sources\install.wim:2
MinShell to Full
Import-Module ServerManager
install-WindowsFeature Server-Gui-Shell -Restart
Full to Server Core
Import-Module ServerManager
Uninstall-WindowsFeature Server-Gui-Shell
Uninstall-Windowsfeature Server-Gui-Mgmt-Infra -Restart
Server Core to Full
start powershell
Import-Module ServerManager
install-Windowsfeature Server-Gui-Mgmt-Infra
install-WindowsFeature Server-Gui-Shell -Restart
But if you’ve started by installing a Core version and try to add back its GUI, you may encounter the famous error 0x800f0906 . This is especially true on a VM. The SOURCE will need to be fixed.
- Execute these commands on the Hyper-V server. The VM is named “Core5” in this example.
- Locate the Server2012 R2 ISO or DVD and know the path. To make my life easier, I copied it to C:\tools\server2012r2.iso
- Open a command prompt and start Powershell
- PS C:\> Set-VMDvdDrive -Path C:\tools\server2012r2.iso -VMName Core5
- Right-click on the server2012R2.iso and MOUNT it. In this example it mounted as Drive E:
- PS C:\> Get-WindowsImage -ImagePath F:\sources\install.wim
Index : 1
Name : Windows Server 2012 R2 SERVERSTANDARDCORE
Description : Windows Server 2012 R2 SERVERSTANDARDCORE
Size : 6,902,679,015 bytes
Index : 2
Name : Windows Server 2012 R2 SERVERSTANDARD
Description : Windows Server 2012 R2 SERVERSTANDARD
Size : 12,043,953,358 bytes
Index : 3
Name : Windows Server 2012 R2 SERVERDATACENTERCORE
Description : Windows Server 2012 R2 SERVERDATACENTERCORE
Size : 6,878,790,813 bytes
Index : 4
Name : Windows Server 2012 R2 SERVERDATACENTER
Description : Windows Server 2012 R2 SERVERDATACENTER
Size : 12,059,712,938 bytes
- Now try the commands in the VM to install the GUI. Use the Index number which corresponds to the version of Server. I.E. Index =2: Windows Server 2012 R2 SERVERSTANDARD
Install-Windowsfeature Server-Gui-Mgmt-Infra -Restart -Source wim:D:\sources\install.wim:2


