How to install windows feature when you removed it with “- Remove” flag

Windows Server 2012 introduced so called “Features on Demand” which is nothing more than fancy term for removal of unused feature binaries (aka “feature payloads”) from your installation to decrease installation footprint, so that you can’t bring them back without using some external source. In conjunction with Minimal Server interface and post install ability to move along Full GUI – Core spectrum a lot of folks trying also to remove feature payloads, i.e. doing something like:

Uninstall-WindowsFeature Server-Gui-Shell -Remove

This works just fine, but bringing removed feature back maybe difficult, especially when you removed feature from OS with applied updates yet you do not have image with such updates applied. And even if you don’t have any updates you may have hard time figuring out how to properly specify source to bring removed feature back. So here is an example how to do it:

First you need to mount your Windows Server installation ISO and make sure that you know relevant drive letter (it is “D” in example below). Next list images available in install.wim file to identify image ID of Windows edition you need (Standard/Enterprise, FULL/CORE) by means of the following command:

Dism /get-wiminfo /wimfile:d\sources\install.wim

Screenshot of the output:

dism-get-wiminfo

In my case it was necessary to use image with index id 2 (Standard edition, full install). With this info you can install required feature specifying image ID as a source:

Install-WindowsFeature Server-Gui-Shell -IncludeAllSubFeature -Source wim:d:\sources\install.wim:2

Sample screenshot:

Install-WindowsFeature from source

I think this example will be enough for you to bring back your “features on demand” 🙂

 

Leave a Reply

Your email address will not be published. Required fields are marked *