By using Windows Powershell and importing the Server Module this can allow for existing roles, role services and features to be duplicated on a destination server. By following the below steps:
1) In order to get the information regarding the installed roles, role services and features we will first need to import the ‘Server Manager’ module into the current powershell session on the source server which contains the roles, role services and features we wish to duplicate to a destination server;
Import-Module ServerManger
2) We will want to retrieve the information regarding the installed roles, role services and features. We will want to duplicate the role services on the destination sever we will include a filter to retrieve all the installed features and then provide a second filter to only contain those with role services installed. The information will be exported to an XML object which in the below example is a UNC path.
Get-WindowsFeature | Where-Object {$_.Installed -eq “True”} | Where-Object {$_.SubFeatures.Count -eq 0} | Export-Clixml \\Servername\share\features.xml
3) We will now connect to the destination server we wish to duplicate the roles, role services and features and as in Step 1 import the ‘Server Manager’ module into the current powershell session.
Import-Module ServerManager
4) We will now need to import the roles, role services and features retrieved from the source server into variable by importing the XML object created in Step 2.
$Features= Import-Clixml \\Servername\Share\Features.xml
5) The variable can be used to pipe all the role, role services and features retrieved from the source server to the Add-WindowsFeature cmdlet to install;
$Features = Add-WindowsFeature
6) Restart the computer if required following the installation of the roles, roles services and features.
What if the server names between the exported XML file and the destination server are different? Like in export it is SERVER-1234 but destionation server is SERVER-5678?
LikeLike
You should be able to import the features and install from the file, there is no binding to the host to which the file was exported from…
LikeLike