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
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:
Get-WindowsFeature | Where-Object InstalledSearch for a feature by name:
Get-WindowsFeature *backup*Install or remove one (the Name column is what you pass):
Install-WindowsFeature -Name Windows-Server-Backup -IncludeManagementTools
Uninstall-WindowsFeature -Name Web-Ftp-ServerWith 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:
Get-WindowsOptionalFeature -Online | Where-Object State -eq "Enabled"
Enable-WindowsOptionalFeature -Online -FeatureName TelnetClient
Disable-WindowsOptionalFeature -Online -FeatureName SMB1ProtocolNewer add-ons such as OpenSSH are capabilities instead:
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.
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-SMB1on 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.
Related guides
Windows VPS & RDP
RunRacks RDP port 12230: how to connect to your Windows VPS and Admin RDP
RunRacks Windows VPS and Admin RDP servers accept Remote Desktop on port 12230, not 3389. Here is how to connect from every device and keep the port open.
- Beginner
- Windows VPS · Admin RDP
- 5 min read
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
Windows VPS & RDP
Create Windows users with Remote Desktop access
Give each person their own Windows login, add them to Remote Desktop Users, test the account and remove access cleanly later.
- Beginner
- Windows VPS · Admin RDP
- 2 min read