Windows VPS & RDP

Add or remove Windows roles and features

List, install and remove Windows Server roles and Windows 10/11 optional features with PowerShell, and keep the server lean.

BeginnerWindows server2 min read

Windows ships with many optional components, from IIS and Hyper-V tools to the old SMB1 protocol and Telnet client. Installing only what you need keeps the server lean and gives attackers fewer things to target.

Windows Server: roles and features

List what is installed:

PowerShell
Get-WindowsFeature | Where-Object Installed

Search for a feature by name:

PowerShell
Get-WindowsFeature *backup*

Install or remove one (the Name column is what you pass):

PowerShell
Install-WindowsFeature -Name Windows-Server-Backup -IncludeManagementTools
Uninstall-WindowsFeature -Name Web-Ftp-Server

With a desktop, you can also use Server Manager → Manage → Add Roles and Features.

Windows 10/11: optional features

Press Windows + R, type optionalfeatures and tick or untick items. Or use PowerShell:

PowerShell
Get-WindowsOptionalFeature -Online | Where-Object State -eq "Enabled"
Enable-WindowsOptionalFeature -Online -FeatureName TelnetClient
Disable-WindowsOptionalFeature -Online -FeatureName SMB1Protocol

Newer add-ons such as OpenSSH are capabilities instead:

PowerShell
Get-WindowsCapability -Online | Where-Object State -eq "Installed"

Check a restart is needed

The output of Install-WindowsFeature has a Restart Needed column. If it says Yes, restart in your next maintenance window.

Warning: Do not remove features you do not recognise. Removing parts of.NET Framework, PowerShell or Remote Desktop components can break programs or cut off your own access. If in doubt, leave it installed.

Good candidates to remove

  • SMB1 (FS-SMB1 on Server): an old file-sharing protocol you almost certainly do not need.
  • Roles you added to test something and no longer use, such as FTP Server.

Troubleshooting

  • "The source files could not be found": the feature's files were removed from the image. Run Windows Update first, then try again.
  • Feature install hangs: check that no Windows Update install is in progress, then restart and retry.

Next steps

Was this guide helpful?

Still stuck?

Ask MdmHost AI for a quick answer, or open a ticket and our team will take a look. We are here 24/7.