Hello again. I was configuring Web server on one of my production servers by using PowerShell, so I said to myself that it was a good opportunity to show you how to configure roles or features by using Windows PowerShell.

You can configure features and roles with PowerShell locally, or remotely.

For the following procedure, please check if the remote server is configured to allow remote management (this is the default configuration setting) and that both source and destination servers are located in the same AD Services domain.

First things first, lets view a list of available and installed roles and features on the local server by running this command in PowerShell:

Get-WindowsFeature

Get-windowsfeature

As you may see, list is quite long:

List of available and installed roles and features

You can type Get-Help to view the syntax and accepted parameters for the Install-WindowsFeature cmdlet.

Get-Help Install-WindowsFeature

The structure of the command should be like this:

Install-WindowsFeature -Name <feature_name>

In case that you want to install this role/feature on a remote server, this is the correct command structure:

Install-WindowsFeature -Name <feature_name> -ComputerName <computer_name> -Restart

where:

feature_name is the command name of a role or feature that you want to install (you can separate multiple values by using commas);

computer_name represents a remote computer on which you want to install roles and features;

-Restart automatically restarts the destination server if required by the role or feature installation.

Lets try to install Web Server (IIS 7.0) with Management Console.

First, lets do it locally:

Install-WindowsFeature -Name Web-Server,Web-Mgmt-Console -Restart

Install locally web server and console

It didn’t require a restart. I just have a warning that Windows Auto Update is not enabled.

If I go to Server Manager, I can see IIS being installed:

IIS installed

IIS Manager was also installed:

IIS Manager installed

Lets do the same thing, but this time remotely:

Install-WindowsFeature -Name Web-Server,Web-Mgmt-Console -ComputerName BRNOLABDC -Restart

Install Web server remotelly

After a successful installation, I have checked a remote server whether or not IIS was installed.

And it was installed successfully altogether with IIS Manager:

IIS on remote server

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Post Navigation