Features on Demand is a very cool thing that comes with Windows Server 2012 R2.
One of the problem in previous versions of Windows Server was how roles and features were stored on the hard disk. Before Windows Server 2012 (I am talking about Windows Server 2008 and 2008 R2), we had all the binary files of installed and non-installed features and roles in a directory Windows\WinSxS.
The point of this was that if you wanted to add a role or enable a feature after Windows Server installation, you could have done this without the need of Windows Server media.
The biggest disadvantage of this approach was that these files took up a lot of space on the disk.
Features on Demand in Windows 2012 solves this issue because admins can disable a role or feature, and also, they can completely remove the role or feature’s files from the disk.
To reinstall a role or feature that has been completely removed, you must have access to the installation files.
But if you know that the server is going to have a specific purpose, e.g. it will be only a DNS server or DHCP or AD, you can remove some role and feature files because you know you won’t need it.
If you want to remove a role or feature completely from the system, use -Remove with the Uninstall-WindowsFeature CMDLET in PowerShell.
Features on Demand
Lets say that we will not use our server as FTP server.
First, lets filter a little bit our Get-WindowsFeature CMDLET:
Listed here, we see FTP server:
We need to include name of the role/feature, which is in this case: Web-Ftp-Server. Optionally, you can also add Web-Ftp-Service, and Web-Ftp-Ext. Just separate it with comma.
Do not forget the -Remove switch
Uninstall-WindowsFeature Web-Ftp-Server,Web-Ftp-Service,Web-Ftp-Ext -Remove
As you can see, it was successful:
If we run Get-WindowsFeature WEB* once again, this time we will have a notification that FTP binaries are removed:
More here: Install or Uninstall Roles