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.
Restart-Computer