
Windows Server 2012 'Features on Demand'
1 min read
On Windows Server 2012, Windows Features you don’t need can be removed completely via PowerShell. The binaries are also deleted from the WinSxS directory, so the OS installation takes up less space and (under certain circumstances) the attack surface of the server shrinks as well.
Removing features
Uninstall-WindowsFeature -Name GPMC -Remove [-vhd "C:\Path\to\Hyper-V VHD\Disk.vhdx"]
Note: as the example shows, features can also be removed directly from VHD files (e.g. from powered-off Hyper-V VMs).
Adding removed features back
Features that were removed can of course be installed again. However, this requires a suitable source medium (source media) with the installation files - alternatively the files can be fetched via Windows Update.