How to install Windows features from Powershell

Powershell is one of the most widely used windows utility nowadays, so using the powershell we can see how to install the windows features in a server. Windows server 2008 and server 2012 contains tons of roles and features for installation but to install roles and features in the windows server, we need to seperately select the servers from the server pools and then only we can install the roles and features. This facility was only available in the Windows server 2012 and higher versions. To install the multiple roles and features in multiple servers i.e. both in server 2008 and in server 2012, we need to depend on the Powershell. So in this post we can see how to install roles and features in the windows server.

For Windows Server 2008 R2 and Windows Storage Server 2008 R2 you need to use the following command

Add-WindowsFeature

So add-windowsfeature powershell command was used in the server 2008 and we cannot use this command in the Windows server 2012 or higher version.

server-features

To install a windows feature such as Telnet Server and Telnet Client, we need to run the command as follows

Add-WindowsFeature Telnet-Server,Telnet-Client

what we are seeing is the installation procedure for the windows server 2008 and now we can see how to install the windows roles and features in the server 2012. The powershell command which was used for installing the features in the server 2012 was as follows..

Install-WindowsFeature

Install-Windowsfeature powershell command can be used both in the Windows Server 2012 and also in the Windows 8.1 operating system. Using this command we can install the roles and features in multiple servers. Using this command we can easily install multiple roles and features by using the wilecard characters. Lets see some of the examples by which we are using this powershell command to install the windows server roles and features .

This powershell command was used to install the web server by importing all the necessary modules from the share folder (this folder was available in the server installation dvd)

Install-WindowsFeature -Name Web-Server -Source \server2winsxs

 This command was used for installing the features which was alredy exported into a xml file.

Install-WindowsFeature -ConfigurationFilePath d:ConfigurationFilesADCSConfigFile.xml

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *