Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

share|improve this question
add comment

1 Answer 1

up vote 4 down vote accepted

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.

share|improve this answer
    
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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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