A: Windows Server 2012 allows for roles and features to be removed from the Windows side-by-side assembly, if they are known to not be needed. This can be done to reduce the disk footprint of a server. (Typically all roles and features are copied to disk even if not installed, to enable fast role and feature installation and consistent patching).

To actually remove all roles and features not installed on a server from the disk, you can use the Windows PowerShell command below. Note that this is not something you should typically do--because later, if you add a removed role or feature, then the bits (e.g., the executables, DLLs) will by default downloaded from Windows Update over the Internet.

Here's the command:

Get-WindowsFeature | Where-Object {$_.Installed -match "False"} | Uninstall-WindowsFeature -Remove

<a href="/content/content/144740/removeeverythingnotusedpowershell.jpg" title="removeeverythingnotusedpowershell" target="_blank"><span class="contentimage" style="width: 388px;"><img alt="removeeverythingnotusedpowershellsml" src="/content/content/144740/removeeverythingnotusedpowershellsml.jpg"><br>
Windows PowerShell Interface Showing Removal Command<br></h3></a>

Mark Minasi has been writing a series about using PowerShell. Check out "Automating PowerShell Reports Part 1."