Convert a Windows Server 2012 GUI to Server Core and Back to GUI

To set up Remote Desktop Protol use the following command: 

netsh advfirewall firewall add rule name=”RDP-In” 
dir=in action=allow protocol=TCP localport=3389

To convert GUI to Server Core use the following commands: 

Import-Module DISM
and
Disable-WindowsOptionalFeature -Online 
-Featurename ServerCore-FullServer

 

To go back to GUI: 

dism /online /enable-feature /featurename:Server-Gui-Mgmt /featurename:Server-Gui-Shell /featurename:ServerCore-FullServer

"Convert a Windows Server 2012 GUI to Server Core and Back to GUI"