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.

  • Beginner
  • Windows VPS · Admin RDP
  • 2 min read

By RunRacks Team · Published

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.

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 RunRacks AI for a quick answer, or open a ticket and our team will take a look at your server.

Windows VPS & RDP

Allow or block multiple RDP sessions for one user

Understand why a new Remote Desktop login takes over your old session, how the single-session policy works on Windows Server, and which setting suits a team.

  • Advanced
  • Windows VPS
  • 5 min read