Is there a way to re-install all Server Roles & Features in Server 2012?

As far as I can see from Server Manager all that can be done is to manually remove each and then re-install but I am hoping that MS have provided some way of just repairing / re-installing all installed roles & features. Anyone know if there is a way of doing that?

The reason for wanting to do this is that I have a Domain Server which after some recent MS updates has started causing numerous event log warnings & errors and has started behaving erratically.

I know that System File Checker will check installed files but that will not fix any registry permissions problems, which is where I think problems have arisen. Guess what I am looking for is some way to recreate the whole registry and it's permissions but without doing a complete re-install.

Thanks, Nick


You could use PowerShell and do something like -

import-module ServerManager

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

After the computer reboots -

Import-CliXML c:\CurrentRoles.xml | 

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

  • Thanks Steven, will give that a try and report back with results. – NickC Dec 30 '12 at 13:02
  • Just tried it out - works perfectly. Many thanks, – NickC Dec 30 '12 at 15:34
  • Great! Glad I could help. – Steven Murawski Dec 31 '12 at 14:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.