Remove Roles and Features Not Installed on Windows Server 2012

In this tutorial from Windows Server on Orcacore, We want to teach you How To Remove all Roles and Features Not Installed on Windows Server 2012.

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.

Point: Typically all roles and features are copied to disk. Even if not installed, to enable fast role and feature installation and consistent patching.

How to Remove all Roles and Features Not Installed on Windows Server 2012

At this point, Let’s get to know Feature on Demand

What’s Feature on Demand?

Features on Demand is a new feature in Windows Server 2012 that allows the installation files for features to be removed from the operating system. This reduces the size of the operating system. The features can be relocated to a file share or downloaded from Windows Update.

Use Feature on Demand to reduce the size of the Windows Server

To use the “Features on Demand” you need to “remove” the binaries required by any features that aren’t currently installed by your OS. You can remove them one by one, but this is a real drag.

At this point, you can use the following command from your Windows PowerShell to remove the binaries for any non-installed features on your system:

get-windowsfeature | where-object -FilterScript { $_.InstallState -eq 'Available' } | remove-windowsfeature -remove
Example of remove unused features and role on windows 2012

Note: 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 be downloaded from Windows Update over the Internet.

When your removal progress is completed, you will see:

Complete removal progress

After you’ve run this command you’ll need to have your Windows install source available if you want to install any additional features. Also, you may need to specify an alternate source location when installing any future features.

Conclusion

At this point, you learn to Remove all Roles and Features Not Installed on Windows Server 2012.

I hope you enjoy this article.

Please subscribe to us on Facebook, Twitter, and Instagram.

Also, you may be interested in these articles:

How To Install Node.js on Windows Server 2022 

How To Redirect www URLs To non-www and HTTP To HTTPS

Install and Configure WAMP on Windows Server 2019

Newsletter Updates

Enter your email address below and subscribe to our newsletter

Stay informed and not overwhelmed, subscribe now!