Powershell to Install RSAT Features in Windows Server 2012 R2

I am setting up a couple of 2012 R2 RDS servers in a small RDS farm (of 2..) and thought it a good opportunity to see what I could do with  powershell.

These RDS servers are for system administrators to manager the environment from. This saves them installing all this stuff on their PC

I tried an add-feature RSAT first, but all it did was install the RSAT tools for roles that were already installed on the server, what I actually wanted was ALL the RSAT tools, so that clusters DCs , ADCS, Bitlocker etc , could all be managed from the one location.

This script installs all the RSAT Features apart from RSAT-NIS, which is deprecated


#HTTP://Britv8.com

# Install all the RSAT Features apart from RSAT-NIS, which is deprecated

#Get a list of features and order them by name
$ListofFeatures = Get-WindowsFeature |Sort-Object -Property name

#Foreach feature , check if it starts with RSAT- and install it
#IF it is RSAT-NIS , don't install it , as it is a deprecated feature

foreach ($RSATFeature in $ListofFeatures)
{
if ($RSATFeature.name -eq "RSAT-NIS")
{
write-host   "Don't install " $RSATFeature.name
}
else
{
if ($RSATFeature.name -like "RSAT-*")
{
write-host   "Installing "   $RSATFeature.name
Add-WindowsFeature $RSATFeature.name
}
else
{
write-host   "Don't install " $RSATFeature.name
}

}
}

#These ones are not prfixed with RSAT, but are part of the tools, so install them anyhow 🙂
Add-WindowsFeature RDS-Licensing-UI
Add-WindowsFeature WDS-AdminPack
Add-WindowsFeature IPAM-Client-Feature
#

Leave a comment

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