How to Install and Manage Windows Features and Roles

Windows Server's functionality is organized into "Roles" (major server functions like Web Server, DNS Server) and "Features" (supporting components) — this guide covers managing these efficiently, primarily via PowerShell.

Roles vs Features: The Distinction

Roles — primary server functions (Web Server/IIS, DNS Server, Active Directory Domain Services, File Server) that define what the server fundamentally does.
Features — supporting or supplementary components (.NET Framework, BitLocker, Windows Backup) that support roles or provide standalone functionality.

Listing Available Roles and Features

Get-WindowsFeature

Shows every available role/feature and whether it's currently installed — a long list; filter for specific relevant entries.

Checking What's Currently Installed

Get-WindowsFeature | Where-Object {$_.InstallState -eq "Installed"}

Installing a Role/Feature

Install-WindowsFeature -Name Web-Server -IncludeManagementTools

-IncludeManagementTools also installs the associated management console/tools, generally recommended unless you're specifically managing purely via PowerShell/remote tools.

Installing Multiple Roles/Features at Once

Install-WindowsFeature -Name Web-Server, DNS, File-Services -IncludeManagementTools

Removing a Role/Feature

Uninstall-WindowsFeature -Name Web-Server

Checking If a Restart Is Required

(Install-WindowsFeature -Name AD-Domain-Services).RestartNeeded

Some role/feature installations require a restart to fully complete — check this explicitly rather than assuming.

Exporting a Server's Configuration for Replication

Get-WindowsFeature | Where-Object InstallState -eq Installed | Export-Csv -Path "installed-features.csv"

Useful for documenting a server's configuration, or as a reference when setting up an equivalent server elsewhere.

Installing Roles/Features on a Remote Server

Install-WindowsFeature -Name Web-Server -ComputerName REMOTE_SERVER -IncludeManagementTools

See How to Configure Windows Server for Remote PowerShell Management (WinRM) for the underlying remote management this depends on.

Practicing Minimalism: Only Install What You Need

Similar to the general security principle of reducing attack surface (see How to Disable Unnecessary Services to Reduce Attack Surface, applying the same principle here), only install roles/features you genuinely need — each additional installed component is potential attack surface and maintenance overhead.

Reviewing Installed Roles/Features Periodically

Periodically audit what's actually installed and in use — remove roles/features that were installed for a purpose no longer relevant, keeping the server's footprint aligned with its actual current needs.

Common Errors

Feature installation fails with a source files error — some features require access to Windows installation media/source files not present by default; specify the source explicitly with -Source pointing to appropriate installation media if this occurs.

Continue Reading

Browse more articles in Windows Server Administration.

  • windows server roles features, install-windowsfeature, get-windowsfeature, windows server role management
  • 0 Utilizadores acharam útil
Esta resposta foi útil?

Artigos Relacionados

How to Connect to a Windows VPS via Remote Desktop (RDP)

Remote Desktop Protocol (RDP) provides full graphical access to a Windows Server VPS, letting you...

How to Secure RDP on a Windows VPS

RDP's default configuration (standard port, password authentication, unlimited login attempts)...

How to Create a New Administrator User on Windows Server

Using only the built-in Administrator account for all management tasks is risky. Creating a...

How to Install Windows Updates on a Windows VPS

Keeping Windows Server updated is essential for security and stability. This guide covers...

How to Configure Windows Firewall on a Windows VPS

Windows Defender Firewall controls which network connections are allowed to and from your server....