You would get error message " Web Server (IIS) Installation Failed. The Server needs to be restarted to undo the changes", when you try to install IIS 7 on  Windows Server 2008/R2. Even after server restart issue occurs again.

Post IIS error, another error message is displayed “ Windows must be reinstalled, An unauthorised change was made to Windows. Windows must be reinstalled to activate. Insert the Windows installation DVD or CD into your computer to begin the reinstallation process

Probable cause:

You would likely to receive aforementioned errors if Windows Servers activated via KMS. In this scenario, Windows was not completely activated (though you would see OS is activated on System Info) hence ,OS prevented IIS installation.

 

 

 

 

 

Fix for 2008 :

 1.        Go to  following folder C:\Windows\ServiceProfiles\NetworkService\AppData\Roaming\Microsoft

2.       Right click SoftwareLicensing folder,  in the security add user slsvc ( NT Service\slsvc – local service account) and provide full control.

3.       Install IIS.

 Fix for 2008 R2 :

 1.        Go to following folder C:\Windows\ServiceProfiles\NetworkService\AppData\Roaming\Microsoft

2.       Right click SoftwareProtectionPlatform folder,  in the security add user sppsvc (NT Service\sppsvc – local service account) and provide full control.

3.       Install IIS.

 

P.S. : Please note the difference between 2008 and 2008 R2 fix. Also, AppData is a hidden folder !

 

Please have a look at MS KB article below.

 

http://support.microsoft.com/kb/978305