Quickly Duplicate Windows Features and Roles On Another Server Using PowerShell

Powershell
Windows

If you have a server that needs to have the same Windows Server features and roles as another system, here’s an easy way to quickly get that done using PowerShell. I did this logged into each server locally, but you could easily use PowerShell remoting to do the same thing.

Step 1: Run PowerShell with ServerManager module:

image

Step 2: Export list of currently installed features to XML

 
Get-WindowsFeature | ? { $_.installed } | Export-Clixml \\server\share\features.xml

 

Step 3: On second server, run PowerShell and import XML

 
$f = Import-Clixml \\server\share\features.xml

 

Step 4: Pipe that bad boy into Add-WindowsFeature!

 
$f | Add-WindowsFeature

 

Step 5: Restart, if needed

 
Restart-Computer

That’s it!

Leave a Reply

Your email address will not be published.