Windows Server · How-To

How to Add Roles and Features in Windows Server

By , Editor · · Server 2016 – 2025
The short answer

In Windows Server you add a role or feature in one of two ways. Open Server Manager, choose Manage → Add Roles and Features, and walk through the Add Roles and Features Wizard using the Role-based or feature-based installation option. Or open an elevated PowerShell window and run one line, for example Install-WindowsFeature -Name Web-Server -IncludeManagementTools. Both do the same job; the wizard is friendlier for a one-off, PowerShell is faster and repeatable across many servers.

This guide is written for the current release, Windows Server 2025, but the steps are essentially identical on Windows Server 2016, 2019 and 2022 — the wizard and the Install-WindowsFeature cmdlet have worked the same way for years. Where a detail is version-specific we call it out.

Roles vs. features — what's the difference?

A role is the primary job a server does for the network: a domain controller (AD DS), a DNS server, a web server (IIS), a Hyper-V host. A role service is a sub-component of a role. A feature is a supporting capability that isn't a server's main purpose — things like Failover Clustering, .NET Framework, or the Windows Server Backup tools. The same wizard installs all three.

Before you start

  • Sign in with an account that is a local administrator on the target server. To manage a remote server or an offline VHD, you need admin rights there too.
  • Know which role you want and its dependencies. The wizard prompts you to add anything a role requires, but it helps to plan ahead — for example, Active Directory wants DNS available.
  • Have the installation source handy for features whose files aren't stored locally (the classic example is .NET Framework 3.5). You can point the wizard or cmdlet at a source path or an install.wim.
  • For a remote target, add the server to Server Manager first (Manage → Add Servers), or use the -ComputerName parameter in PowerShell.
Plan production changes carefully

Adding some roles restarts services or the whole server, and roles like AD DS, DHCP and Hyper-V change how the machine behaves on the network. Do this in a maintenance window, make sure you have a current backup or checkpoint, and never test a new role on a live domain controller you can't afford to reboot.

Method 1 — the Add Roles and Features Wizard

This is the graphical, click-through method built into Server Manager, and the page order below follows the sequence set out in Microsoft's Add or Remove Roles and Features in Windows Server documentation. It targets one server per session.

  1. Open the Start menu, type Server Manager, and open it. On a fresh install Server Manager launches automatically at sign-in.
  2. In the top-right corner, click Manage, then select Add Roles and Features. The wizard opens.
  3. On the Before You Begin page, read the reminders (strong password, current network settings, latest updates), then click Next.
  4. On Installation Type, choose Role-based or feature-based installation and click Next. (The other option, Remote Desktop Services installation, is a separate multi-server deployment flow and isn't covered here.)
  5. On Server Selection, pick the local server or a remote server you've added to Server Manager. To target an offline virtual disk instead, choose Select a virtual hard disk, pick the host to mount it on, and browse to the VHD. Click Next.
  6. On Server Roles, tick the role(s) you want. If a role needs extra roles or features, a pop-up asks you to Add Features — accept it. Leave the box Include management tools ticked unless you'll manage the role from elsewhere. Click Next. (If you only want a feature, add nothing here and continue.)
  7. On Features, tick any standalone features you need, then click Next.
  8. Some roles show one or more extra information/configuration pages here (for example, a Web Server Role (IIS) intro followed by a Role Services list). Make your selections and click Next through them.
  9. On Confirmation, review your choices. Optionally tick Restart the destination server automatically if required. If the files live elsewhere, click Specify an alternate source path. To reuse these choices later, click Export configuration settings and save the XML. When ready, click Install.
  10. Watch the Results page. You can close the wizard and let installation continue in the background — progress shows under the flag icon in Server Manager. When it finishes, click Close, and complete any post-deployment configuration the yellow notification flag points to.
Tip: the alternate source path format

If a feature's files aren't on the server, you can point to a WIM image using the prefix and index format, for example WIM:e:\sources\install.wim:4, where the number is the image index that contains the files. A UNC share works too, but the destination server's computer account must have Read access to it — user access alone isn't enough.

Method 2 — PowerShell with Install-WindowsFeature

The ServerManager module ships with Windows Server, so no install is needed. Everything the wizard does can be scripted, and unlike the wizard, PowerShell can hit many servers at once. Run PowerShell as Administrator.

See what's available

List every role and feature and its status:

Get-WindowsFeature

The Name column (e.g. Web-Server, AD-Domain-Services) is the ID you pass to the install cmdlet. Add -ComputerName <server> to inspect a remote machine even if it isn't in Server Manager.

Install a role

Name one or more features. Because the cmdlet does not add management consoles by default — a difference from the wizard that the Install-WindowsFeature cmdlet reference on Microsoft Learn calls out explicitly — include -IncludeManagementTools when you want them:

Install-WindowsFeature -Name DNS,DHCP -IncludeManagementTools

Useful switches:

  • -IncludeManagementTools — add the role's consoles/snap-ins (off by default in PowerShell).
  • -IncludeAllSubFeature — add every sub-role-service and sub-feature under what you named.
  • -Restart — reboot automatically, but only if the installation actually requires it.
  • -ComputerName <server> — target a remote server (one name per command).
  • -Source <path> — supply feature files that aren't in the local store.
  • -WhatIf — preview what would be installed without changing anything.

The result looks like this — check Restart Needed:

Success Restart Needed Exit Code      Feature Result
------- -------------- ---------      --------------
True    No             Success        {DHCP Server, DNS Server}

Preview a full IIS install with every role service before committing:

Install-WindowsFeature -Name Web-Server -IncludeAllSubFeature -IncludeManagementTools -WhatIf

List what's currently installed at any time:

Get-WindowsFeature | Where-Object Installed -eq $true
Note on the old cmdlet name

You may see older scripts use Add-WindowsFeature. That name still works as an alias, but Install-WindowsFeature is the correct current cmdlet — use it in new scripts.

Common roles and their PowerShell names

A quick reference to the roles most people add, with the exact -Name value. Remember to append -IncludeManagementTools in PowerShell if you want the console.

Role PowerShell name Notes
Active Directory Domain ServicesAD-Domain-ServicesInstalls binaries only — you still promote to a DC afterwards.
DNS ServerDNSOften paired with AD DS.
DHCP ServerDHCPNeeds post-install authorization in AD and a scope.
File Server (File and Storage Services)FS-FileServerFile and Storage Services is partly present by default.
Web Server (IIS)Web-ServerAdd -IncludeAllSubFeature for a full install.
Hyper-VHyper-VNeeds hardware virtualization; requires a reboot.
AD DS: the role isn't the whole job

Installing AD-Domain-Services does not create a domain or turn the machine into a domain controller. That is a second, separate step: use the post-deployment notification in Server Manager (Promote this server to a domain controller) or run Install-ADDSForest, Install-ADDSDomain or Install-ADDSDomainController in PowerShell. Until you promote it, Active Directory isn't running.

Adding roles to several servers at once

The wizard can't; PowerShell can. First build an XML file: run the wizard, make your selections, and on the Confirmation page click Export configuration settings. Then feed that file to each server — background jobs let them run concurrently:

$servers = 'server01','server02','server03'
$config  = 'C:\Deploy\DeploymentConfigTemplate.xml'

$jobs = foreach ($s in $servers) {
    Start-Job { Install-WindowsFeature -ConfigurationFilePath $using:config -ComputerName $using:s -Restart }
}
Receive-Job -Job $jobs -Wait | Select-Object Success, RestartNeeded, ExitCode, FeatureResult

All targets must run the same Windows Server version as the machine you launch this from. A newer OS can manage an older one (Server 2025 can configure Server 2022), but not the reverse.

How to remove a role or feature

Removal mirrors installation. In the GUI, open Server Manager → Manage → Remove Roles and Features, pick the server, then clear the checkboxes for the roles and features you no longer want, and step through to Remove. The wizard prompts you to remove anything that depended on them, and offers the same automatic-restart checkbox.

In PowerShell, use Uninstall-WindowsFeature with the same names:

Uninstall-WindowsFeature -Name DNS,DHCP -IncludeManagementTools

Add -Restart to reboot automatically if the removal needs it — the Uninstall-WindowsFeature reference on Microsoft Learn notes the same tools-not-removed-by-default behaviour applies here too. A removal often reports Restart Needed: Yes — the role isn't fully gone until you reboot.

Removing a role can delete its configuration

Uninstalling doesn't just remove binaries — it can also tear down that role's data and settings (DHCP scopes, IIS sites, and so on). Export or back up anything you might need before you remove a production role, and never demote or uninstall AD DS from a domain controller without first understanding the impact on your domain.

Which method should you use?

Use the wizard when you're setting up a single server by hand, exploring what a role includes, or you simply prefer clicking. Use PowerShell when you want speed, when you're building the same server repeatedly, when you're on Server Core (there is no wizard), or when you need to hit many servers. Many admins do both: click through the wizard once, hit Export configuration settings, and reuse that XML with Install-WindowsFeature forever after.

Frequently asked

Do I need to restart the server after adding a role?

Some roles and features require a restart to finish installing, and others do not. In the wizard you can tick "Restart the destination server automatically if required" on the Confirmation page. In PowerShell, add the -Restart switch to Install-WindowsFeature so the server reboots automatically only if the installation needs it. If you skip the restart, check the Restart Needed column in the output and reboot manually when it says Yes.

Why does the PowerShell command not install the management tools?

By design. The Add Roles and Features Wizard installs a role's management tools by default, but Install-WindowsFeature does not. Add the -IncludeManagementTools parameter when you want the consoles and snap-ins, such as the DNS or DHCP management console, installed alongside the role. On a Server Core installation only the command-line and PowerShell tools are added, because there is no desktop to host the graphical snap-ins.

Does installing the Active Directory Domain Services role make the server a domain controller?

No. Adding the AD DS role only installs the binaries. You still have to promote the server to a domain controller as a separate step, either from the yellow post-deployment notification in Server Manager or by running Install-ADDSForest, Install-ADDSDomain or Install-ADDSDomainController in PowerShell. Until you promote it, Active Directory is not actually running.

Can I add roles to more than one server at once?

Not with the wizard, which targets a single server per session. PowerShell can. Export your selections to an XML configuration file from the wizard's Confirmation page, then run Install-WindowsFeature -ConfigurationFilePath against each server, looping through the names or using background jobs to run them concurrently. Every target server must be running the same version of Windows Server as the machine you run the command from.

More Windows help

Browse all how-to guides, dig into related server storage with our Windows Storage Spaces guide, or explore the historical posts in the windows-now.com archive.