The tool was unable to install Application Server Role, Web Server (IIS) Role.
Log:
Error: The tool was unable to install Application Server Role, Web Server (IIS) Role. Last return code (2) Options for further diagnostics: 1. Look up the return code value 2. Download the prerequisite manually and verify size downloaded by the prerequisite installer. 3. Install the prerequisite manually from the given location without any command line options. Cannot retry
Issue/Cause :
When you use the PrerequisiteInstaller.exe, it will execute a Windows PowerShell command to install the necessary Roles and Features to configure Windows Server 2012 for SharePoint 2013. Part of the Windows PowerShell code for Add-WindowsFeature installation installs the Windows NET-Framework-Core feature that is the Microsoft .NET Framework 3.5. This feature installation requires binaries and other files that are not included in a default installation of Windows Server 2012. These binaries and other files will be downloaded by the PrerequisiteInstaller.exe application from Windows Update through an online connection.
Fix:
Make sure you have an active internet connection and that theirs no antivirus or anything else on the network preventing the installer from accessing the files and binaries.
Import-Module ServerManager Add-WindowsFeature NET-WCF-HTTP-Activation45,NET-WCF-TCP-Activation45,NET-WCF-Pipe-Activation45 Add-WindowsFeature Net-Framework-Features,Web-Server,Web-WebServer,Web-Common-Http,Web-Static-Content,Web-Default-Doc,Web-Dir-Browsing,Web-Http-Errors,Web-App-Dev,Web-Asp-Net,Web-Net-Ext,Web-ISAPI-Ext,Web-ISAPI-Filter,Web-Health,Web-Http-Logging,Web-Log-Libraries,Web-Request-Monitor,Web-Http-Tracing,Web-Security,Web-Basic-Auth,Web-Windows-Auth,Web-Filtering,Web-Digest-Auth,Web-Performance,Web-Stat-Compression,Web-Dyn-Compression,Web-Mgmt-Tools,Web-Mgmt-Console,Web-Mgmt-Compat,Web-Metabase,Application-Server,AS-Web-Support,AS-TCP-Port-Sharing,AS-WAS-Support, AS-HTTP-Activation,AS-TCP-Activation,AS-Named-Pipes,AS-Net-Framework,WAS,WAS-Process-Model,WAS-NET-Environment,WAS-Config-APIs,Web-Lgcy-Scripting,Windows-Identity-Foundation,Server-Media-Foundation,Xps-Viewer
Note:
After you complete the Microsoft SharePoint Products Preparation Tool, you must still install the following 4 updates: