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
- How to Install IIS on a Windows VPS
- How to Install and Configure Active Directory Domain Services
- How to Set Up DNS Server Role on Windows Server
Browse more articles in Windows Server Administration.