Seriously…WTF. I spent two days trying to figure out this issue and finally I went digging into
%WINDIR% to find my answer.
I was trying to run the Prerequisite Installer for SharePoint 2013 on Server 2012 R2 but I kept getting the error in the title line
The tool was unable to install Application Server Role, Web Server (IIS) Role.
After beating my head against the wall for about 2 days straight, I finally read the log file and the answer was staring at me the entire time.
The installer is trying to run the executable
`2014-09-03 23:45:23 - “C:\Windows\system32\ServerManagerCmd.exe” -inputpath “somepath”
Taking a look in the system32 directory, you’ll see that in R2,
ServerManagerCMD.exe doesn’t exist! How do we fix that? We do the logical thing. Take
ServerManager.exe, copy it, and rename it to
ServerManagerCMD.exe. Who cares if it’s messy, it works. Case in point:
So apparently there is more involved. The prereq installer kept going. I eventually stopped it at 17 hours. I figured it wasn’t doing anything (and it wasn’t). So I was thinking, well shucks this sucks. But then I had an idea.
On this knowledge base article, Microsoft lists out the requirements for SP2013 roles and features and gives a PowerShell script for it. I tried the script to install the features and then I reran the prereq installer and everything started working.
I simplified this entire process for myself in the future and for everyone who reads this (hopefully people read this).
Copy-Item -Path "$($ENV:SystemRoot)\System32\ServerManager.exe" `
-Destination "$($ENV:SystemRoot)\System32\ServerManagerCmd.exe" -Force
Add-WindowsFeature Net-Framework-Features,Web-Server,Web-WebServer, `
AS-Web-Support,AS-TCP-Port-Sharing,AS-WAS-Support, AS-HTTP-Activation, `
Once it reboots, run the prereq installer again.