Sometime you need to ‘clone’ the Windows feature-set of a specific server. That’s a task I’m currently working on. Using PowerShell to enumerate/list all enabled Windows Features is easy…
First you need to Import the ServerManager Module, then list the Modules:
PS C:\> Import-Module ServerManager
PS C:\> Get-WindowsFeature | Where-Object {$_.Installed -match “True”} | Select-Object -Property Name
Name
—-
File-Services
FS-FileServer
Web-Server
Web-WebServer
Web-Common-Http
Web-Static-Content
Web-Default-Doc
Web-Dir-Browsing
Web-Http-Errors
Web-App-Dev
Web-Asp-Net
Web-Net-Ext
Web-ISAPI-Ext
Web-ISAPI-Filter
Web-Health
Web-Http-Logging
Web-Log-Libraries
Web-Request-Monitor
Web-Http-Tracing
Web-Custom-Logging
Web-Security
Web-Windows-Auth
Web-Digest-Auth
Web-Client-Auth
Web-Cert-Auth
Web-Filtering
Web-Performance
Web-Stat-Compression
Web-Mgmt-Tools
Web-Mgmt-Console
NET-Framework
NET-Framework-Core
RSAT
RSAT-Role-Tools
RSAT-Web-Server
Telnet-Client
PowerShell-ISE
PS C:\>
Image may be NSFW.
Clik here to view.
Next, if you want to redirect the output to a file add a pipe and out-file <file path> to the above command/call
PS C:\> Get-WindowsFeature | Where-Object {$_.Installed -match “True”} | Select-Object -Property Name | Out-File C:\Temp\WindowsFeatures.txt
To ‘clone’ another server/add exactly the same feature-set to another Server, simple add Add-WindowsFeature in front of every Feature. it should look like that:
Add-WindowsFeature File-Services
Add-WindowsFeature FS-FileServer
Add-WindowsFeature Web-Server
Add-WindowsFeature Web-WebServer
Add-WindowsFeature Web-Common-http
Add-WindowsFeature Web-Static-Content
Add-WindowsFeature Web-Default-Doc
Add-WindowsFeature Web-Dir-Browsing
Add-WindowsFeature Web-Http-Errors
Add-WindowsFeature Web-App-Dev
Add-WindowsFeature Web-Asp-Net
Add-WindowsFeature Web-Net-Ext
Add-WindowsFeature Web-ISAPI-Ext
Add-WindowsFeature Web-ISAPI-Filter
Add-WindowsFeature Web-Health
Add-WindowsFeature Web-Http-Logging
Add-WindowsFeature Web-Log-Libraries
Add-WindowsFeature Web-Request-Monitor
Add-WindowsFeature Web-Http-Tracing
Add-WindowsFeature Web-Custom-Logging
Add-WindowsFeature Web-Security
Add-WindowsFeature Web-Windows-Auth
Add-WindowsFeature Web-Digest-Auth
Add-WindowsFeature Web-Client-Auth
Add-WindowsFeature Web-Cert-Auth
Add-WindowsFeature Web-Filtering
Add-WindowsFeature Web-Performance
Add-WindowsFeature Web-Stat-Compression
Add-WindowsFeature Web-Mgmt-Tools
Add-WindowsFeature Web-Mgmt-Console
Add-WindowsFeature NET-Framework
Add-WindowsFeature NET-Framework-Core
Add-WindowsFeature RSAT
Add-WindowsFeature RSAT-Role-Tools
Add-WindowsFeature RSAT-Web-Server
Add-WindowsFeature PowerShell-ISE