Re-install (repair) Server 2012 Roles & Features

Solution 1:

You could use PowerShell and do something like -

import-module ServerManager

Get-WindowsFeature | 
  Where-Object {$_.installed} | 
  Tee-Object -Variable CurrentRoles | 
  Remove-WindowsFeature
$CurrentRoles | 
  Export-CliXML c:\CurrentRoles.xml
Restart-Computer

After the computer reboots -

Import-CliXML c:\CurrentRoles.xml | 
  Add-WindowsFeature
Restart-Computer

I haven't run this exact sequence, so test before running in production, but I have used this pattern for server provisioning.