Want to fully remove a feature ?

New to Windows 2012 is the ability to reduce your attack surface further by physically removing binaries from the operating system. Its really quite simple to do. Using the uninstall-windowsfeature command we append the -remove switch and that removes the install binaries from the hard drive.

If you need to add them back then, when using the install-windowsfeature command you will need to add the -source switch and make the installation source available (from a DVD or extracted ISO).

The easiest way to achieve this is to extract the sourcesSxS folder from the install DVD to a file share. The file share will need to be able to be accessed by computer accounts with Read rights. In this way, the features are available for install to any server if they have been removed.

Restoring the GUI in Windows Server 2012

If you want to restore the GUI in Windows Server 2012 (and you didn’t install in core mode) you can use the following command

Install-WindowsFeature Server-Gui-Shell, Server-Gui-Mgmt-Infra -restore

If you did install core, you need to have the CD / ISO inserted or mounted and append the -Source switch to tell it where to get the files to perform the install of the GUI from. i.e. you enter:

Install-WindowsFeature Server-Gui-Shell, Server-Gui-Mgmt-Infra -Source C:Source -restart