Q. How can I add and remove Windows roles and features from PowerShell in Windows Server 2008 R2?

A. Server 2008 R2 introduces PowerShell cmdlets for the management of Roles and Features. To use them, you just need to import the ServerManager library in PowerShell:

Import-Module servermanager

You can now add and remove roles and features using the Add-WindowsFeature and Remove-WindowsFeature cmdlets. To check all the available roles and features and their install statuses, use the Get-WindowsFeature cmdlet. If the feature is installed, an \[X\] is displayed, as the sample below shows.



The name on the right side is the name needed to install or remove the feature. For example,

Add-WindowsFeature Hyper-V

would install Hyper-V.

Related Reading:



Check out hundreds more useful Q&As like this in John Savill's FAQ for Windows. Also, watch instructional videos made by John at ITTV.net.
Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish