Home MCSA 2012R2 70-410 Optimize Resources using Features On Demand

Optimize Resources using Features On Demand

Reading Time: 3 minutes

Remove Feature On Demand Packages

For this example we will remove the Server-Gui-Shell turning the GUI Server into a Minial Instance Server leaving Server Manager still installed.

From the Desktop we can launch Powershell and type:

Get-WindowsFeature |  Where InstallState -Eq Installed

As you can see from the graphic above the role we are looking for is Server-Gui-Shell. i Should note that when using FOD when the role is removed it also removed the installation package from the local server which saves spaces, or can prevent other system admins in accidentally installing roles onto a specific server. to remove the role from the server you can use the following command below:

Remove-WindowsFeature -Name 'Server-Gui-Shell' -Remove -WhatIf

Using the -WhatIf parameter we can see what will happen when the role is removed. if we are happy with the above you can re-run the command without the -WhatIf parameter

Remove-WindowsFeature -Name 'Server-Gui-Shell' -Remove

The Role has now been removed and the server is pending a restart to complete the final operation.

Running the PowerShell Command below we can see the roles and featues which are in a removed state

 Get-WindowsFeature | Where InstallState -Eq Removed

Finally we can restart the server.

Restart-Computer -Force

After the Server has rebooted and we’ve logged back in this is the updated desktop/interface you will receive:

Install Feature On Demand Packages

You will need to Mount the Windows Server Installation ISO to either your server or copy the media to a network location that your server can have access to. For this exmaple i have mounted the 201R2 installation media the virtual machine. The ISO is mounted under D:\

When installing FOD Packages we are required to use the install.wim file, unlike when installing /NetFx 3.5 we can specify D:\Sources\SXS
To Check the WIM Idenitifer number we can use the following command:

Get-WindowsImage -ImagePath D:\Sources\install.wim

To Re-install the Server-Gui-Shell we can use the following Powershell Command:

Install-WindowsFeature -Name 'Server-Gui-Shell' -Source WIM:D:\sources\install.wim:2

Then Restart The Server.


Previous articlePlan for a Server Upgrade
Next articleSMTP4DEV
Hi, I'm Simon an IT Enthusiast, PowerShell Geek, Gamer, and Sound Engineer. I've been working with in the IT Industry for around 6 years and have worked across private and public sector companies. The original idea behind "hypervlab" was that I required an 'RnD' environment which would allow me to be able to replicate any kind of enterprise on-premise environment which I could use for learning and testing without learning in a production environment. So in 2019, I decided to branch out and use the domain for a public facing blog to be able to contribute to the IT Community about all things Microsoft.


Please enter your comment!
Please enter your name here