Cheap SharePoint 2013 Hosting:: How to Fix “Error: The tool was unable to install Application Server Role, Web Server (IIS) Role”

For almost all of my SharePoint Installations (2010 and 2013) be it on a single server or a large farm of many servers, I use autospinstaller, an open source PowerShell script library for scripted SharePoint installs. However autospinstaller failed during the SP2013 prerequisites install on the R2 server with the following errors.

cheap sharepoint 2013 hosting
Error: The tool was unable to install Application Server Role, Web Server (IIS) Role

SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired
2013-10-02 15:59:02 – Error: The tool was unable to install Application Server Role, Web Server (IIS) Role.
2013-10-02 15:59:02 – Last return code (2)
2013-10-02 15:59:02 – 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.
2013-10-02 15:59:02 – Cannot retry

The SharePoint 2013 prerequisite installer checks the OS version and detects it as unsupported as well as the AppFabric install requires special configurations. Due to these issues I decided to install the prerequisites manually but use autospinstaller for SharePoint install. Below is the order in which I performed the tasks to fix it.

To solve the issue I set the following Local Policy:

1. Windows Start
2. run MMC
Error in SharePoint 2013a
3. Click File, Add/Remove Snap-in…
Error in SharePoint 2013
4. Select Group Policy Object Editor and ADD it
Error in SharePoint 2013
5. Navigate to Administrative templates / System
Error in SharePoint 2013
6. Select and edit “Specify Settings for optional component installation and component repair”
7. Enable and select “Contract Windows Update directly to download repair content instead of Windows Server Update Services (WSUS)”
Error in SharePoint 2013
8. Re run the prerequisite installation

Professional SharePoint 2013 Hosting with

With SharePoint, your Microsoft SharePoint site hosting choices include shared or dedicated hosting of Windows SharePoint Foundation 2013, SharePoint Foundation 2010, SharePoint Server 2013, and SharePoint Server 2010. That means your team and partners can easily connect and collaborate through an intranet, extranet, or through the web. With a hosted SharePoint web site, employees are able to harness the robust power of SharePoint hosting for social networking, to share files, run blogs and wikis, and distribute information.
Get organized with our SharePoint Foundation 2013 Hosting, the leading Microsoft web hosting solution for secure document management, content management, and workflow features for your intranet or extranet requirements.