08 July 2015

IIS error when installing SharePoint 2013 on Windows Server 2012 R2 : The tool was unable to install Application Server Role, Web Server (IIS) Role

This error has cost me five or six hours. Then I tried everything from applying patches, trying to install IIS manually, etc. Once I figured it out, I installed SharePoint Server and went with my life happily.
It happened to one of my colleague and I couldn't remember what fix I did a month ago. Later, I figured it out and solved. I'm documenting it here so that if anyone come across the same issue, they can solve it.

This error occurred because the pre-request installer is trying to execute ServerManagerCmd.exe from system 32 folder and failing. (I found out this from the pre-request installer logs). So I get in to the system32 folder to see what this fuss about. Voila! There was no ServerManagerCmd.exe in the folder, instead there was a ServerManager.exe. Looks like the executable file was renamed in WS 2012 R2.

So, I made duplicate copy of ServerManager.exe by copy and pasting in the same folder(system32), then renamed the copy as  ServerManagerCmd.exe. Ran the pre-request installer again and installed successfully.


Issue: The tool was unable to install Application Server Role, Web Server (IIS)

                Step 1: Navigate to system32 folder (C:\Windows\system32)
                Step 2: Copy ServerManager.exe and paste in the same location. (system32 folder)
                Step 3: Rename ServerManager-Copy.exe to ServerManagerCmd.exe
                Step 4: Run the pre-request installer

By the way, SharePoint 2013 with SP1 works fine without any workarounds. So, If you have Windows Server 2012 R2, it is recommended to install SharePoint 2013 with SP1.