Skip navigation
Q: How can I remove unused roles and features from my customized Windows Server installation to reduce the disk footprint?

Q: How can I remove unused roles and features from my customized Windows Server installation to reduce the disk footprint?

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

removeeverythingnotusedpowershellsml
Windows PowerShell Interface Showing Removal Command

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

 

Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish