Friday, November 11, 2011

Disable the GUI in Windows Server 8 with PowerShell

Last month I installed Windows Server Developer Preview (Windows Server 8). This can be found here: Windows Server 8 installed

There is the choice between installing the Full Installation, Server Core or Features on Demand edition. By default when doing a Full Installation the GUI is installed. In this blogpost I wil explain how to remove the GUI with usage of PowerShell.

This is the default screen after doing a Full Installation

Start Windows PowerShell with the default button available

In PowerShell the following commands are needed to remove the GUI:
  • Import-Module ServerManager
  • Get-WindowsFeature
  • Remove-WindowsFeature Server-Gui-Shell
  • Shutdown /r /t 5

After reboot the default screen is changed, no background anymore..

When logon, Server Manager and a command window is started

In PowerShell it's possible to enable or disable Windows features again

Open the command window for that and use the following commands:
  • PowerShell
  • Import-Module ServerManager
  • Get-WindowsFeature
  • Add-WindowsFeature <Name> (or)
    Remove-WindowsFeature <Name>

The following command are needed to install the GUI again:
  • Add-WindowsFeature Server-Gui-Shell
  • Shutdown /r /t 5

If needed, Windows PowerShell Getting Started Guide:
http://msdn.microsoft.com/en-us/library/windows/desktop/aa973757(v=vs.85).aspx


Thanks to @RandolphWinjaja for PowerShell support.

1 comment:

  1. Sweet. Thanks for explaining it.. Just installed the full installation, but it had the GUI installed.

    Really much thanks :)

    ReplyDelete