Installing a Server Role and its required features using PowerShell

Share this:

Using the GUI is awesome when you have to do the process a couple of times, but if you have to repeat that several times, then PowerShell is the way to go. In this Tutorial we are going over the process to show how to install the a role (DHCP) and its features using PowerShell.

Solution


When using the GUI, we can always select the role using Add Roles and Features Wizard and a dialog box asking to add the additional features will be displayed, as shown in the image below.

image

If we want to repeat the same process with a single PowerShell line we can use the following cmdlet:

Add-WindowsFeature DHCP –IncludeManagementTools

image

Written by Anderson Patricio

Anderson Patricio

Anderson Patricio is a Canadian MVP in Cloud and Datacenter Management, and Office Server and Services, besides the Microsoft Award he also holds a Solutions Master (MCSM) in Exchange and several other certifications. Anderson has been contributing to the Microsoft Community with articles, tutorials, blog posts, twitter, forums and book reviews. He is a regular contributor here at ITPROCentral.com, MSExchange.org, Techgenix.com and Anderson Patricio.org (Portuguese).