How To Remotely Add Features To Many Windows 2008 R2 Servers Using PowerShell

It’s easy to add features to Windows 2008 R2 remotely using the System Manager, but what if you want to add features to many servers remotely? In that case, you need a PowerShell script to add features to the remote computers.

Here’s a PowerShell script to remotely add features to many Windows 2008 R2 servers, but before we run this, we need to enable PowerShell Remoting.

Once you’ve enabled PowerShell Remoting, run this PowerShell script:

$ServerGroup = new-pssession -computername (Get-Content C:\Servers.txt) -credential domain\adminuser
#Sets your variable for the group of servers.  Can also use -computername server1,server2,server3 if you like.  Additionally sets your credentials for the remote servers.

invoke-command -session $ServerGroup -scriptblock {import-module servermanager}
#Runs the command “import-module servermanager” against your group of servers

invoke-command -session $ServerGroup -scriptblock {add-windowsfeature featurename}
#Adds the specified Windows Feature to each server in the group

VN:D [1.9.22_1171]
Rating: 1.5/10 (2 votes cast)
How To Remotely Add Features To Many Windows 2008 R2 Servers Using PowerShell, 1.5 out of 10 based on 2 ratings

Leave a comment

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