As this is a lengthy article, the following links will bring you right to the solutions:
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
Prerequisites that must be downloaded and installed:
If you run the PrerequisiteInstaller.exe on an offline instance of Windows Server 2012, you’ll experience the error message “The tool was unable to install Application Server Role, Web Server (IIS) Role”:
(Click image to enlarge)
This tool requires an Internet connection to install Roles/Features and to download/install other Prerequisite files. Above is the first error screen you'll encounter if installing offline. Essentially if you are performing an offline installation using the PrerequisiteInstaller.exe, you won't be able to get any farther than this. If you click on the "Review the log file” the log entries for this error will resemble the following. I’ve included many log entries for your review so you can piece together some of the bigger picture:
2012-11-23 21:31:55 - Beginning download/installation 2012-11-23 21:31:55 - Created thread for installer 2012-11-23 21:31:55 - "C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe" -ExecutionPolicy Bypass "C:\Users\ADMINI~1.PHO\AppData\Local\Temp\1\Pre75B8.tmp.PS1" 2012-11-23 21:31:56 - Request for install time of Application Server Role, Web Server (IIS) Role 2012-11-23 21:01:57 - Install process returned (0) 2012-11-23 21:01:57 - [In HRESULT format] (0) 2012-11-23 21:01:57 - "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe" -I 2012-11-23 21:01:57 - Install process returned (0) 2012-11-23 21:01:57 - [In HRESULT format] (0) 2012-11-23 21:01:57 - "C:\Windows\system32\cscript.exe" "C:\Windows\system32\iisext.vbs" /enext "ASP.NET v4.0.30319" 2012-11-23 21:01:57 - Install process returned (1) 2012-11-23 21:01:57 - [In HRESULT format] (-2147024895) 2012-11-23 21:01:57 - Error when enabling ASP.NET v4.0.30319 2012-11-23 21:01:57 - Last return code (1) 2012-11-23 21:01:57 - Reading the following DWORD value/name... 2012-11-23 21:01:57 - Flags 2012-11-23 21:01:57 - from the following registry location... 2012-11-23 21:01:57 - SOFTWARE\Microsoft\Updates\UpdateExeVolatile 2012-11-23 21:01:57 - Reading the following string value/name... 2012-11-23 21:01:57 - PendingFileRenameOperations 2012-11-23 21:01:57 - from the following registry location... 2012-11-23 21:01:57 - SYSTEM\CurrentControlSet\Control\Session Manager 2012-11-23 21:01:57 - Reading the following registry location... 2012-11-23 21:01:57 - SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\RebootRequired 2012-11-23 21:01:57 - Error: The tool was unable to install Application Server Role, Web Server (IIS) Role. 2012-11-23 21:01:57 - Last return code (1) 2012-11-23 21:01:57 - 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. 2012-11-23 21:01:57 - Cannot retry
So in reviewing this log, you can see that the Prerequisite installer executes a PowerShell script, in my case "C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe" -ExecutionPolicy Bypass "C:\Users\ADMINI~1.PHO\AppData\Local\Temp\1\Pre75B8.tmp.PS1" (the filename of this PowerShell script may be different in your environment). This is where the PrerequisiteInstaller.exe temporarily stores the PowerShell script that it executes to install the Roles/Features. The folder in which this PowerShell script is stored is also the location where (in an Internet connected installation) the PrerequisiteInstaller.exe will store other Prerequisite files as they are downloaded.
As we see near the end of the log, it provides an error confirming the installer was “unable to install Application Server Role, Web Server Role (IIS)”.
The issue with this log is that it is not clear that the issue is caused by the installer’s inability to access Windows Update, although the Windows Update is mentioned in the log, so there is your clue. Windows Update is required for the installation of the Net-Framework-Features and this will also install Net-Framework-Core which is .NET 3.5. This feature installation requires binaries and other files that are not included in a default Windows Server 2012 installation and need to be downloaded from Windows Update by the PrerequisiteInstaller.exe application to continue installation using this method. So no real resolution action is clearly suggested regarding how to fix this problem. Not to worry, this article includes the solution regarding how you can get around this issue.
Examples you’ll find online will show you PowerShell similar to the following (ensure this is run at an elevated prompt, i.e. Run as Administrator) to manually install the Windows Server 2012 Roles/Features required by SharePoint 2013.
Import-Module ServerManager
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
The above code is the PowerShell that the PrerequisiteInstaller.exe will execute (in the PowerShell script file indicated in the above section) and it will fail if the server does not have an internet connection. We now know that the reason is Windows Update is required for the installation of the Net-Framework-Features will also install Net-Framework-Core which is .NET 3.5 and this required binaries and other files that are not included in a default Windows Server 2012 installation.
When the above PowerShell is executed in an Offline environment, the required Roles/Features for Windows Server 2012 are not installed which is the same experience when you execute PrerequisiteInstaller.exe. Here is the error message you can expect to see from PowerShell: (Click image to enlarge)
Now this is error message is more useful.
Add-WindowsFeature : The request to add or remove features on the specified server failed. Installation of one or more roles, role services, or features failed. The source files could not be downloaded. Use the “source” option to specify the location of the files that are required to restore the feature. For more information on specifying a source location, see http://go.microsoft.com/fwlink/?LinkId=243077. Error : 0x800f0906
When you visit the provided link, it says that you need to in some way restore your Windows Server 2012 installation. What!? But this is a fresh, clean and default install. Well it helps to know that the Net-Framework-Core feature is ‘Removed’ by default (you can confirm this at an elevated PowerShell prompt (i.e. Run as Administrator) by executing Get-WindowsFeature and looking at the status of Net-Framework-Core) and this is what the message is referencing – you need to restore this. For completeness, the Net-Framework-Features feature will automatically install the Net-Framework-Core feature. The linked articles within this page aren’t entirely useful to address our specific issue. These pages talk about ‘sources’ but not in the specific context that will help solve our problem.
The clues to the solution are the following specific items from the error message:
Open up Internet Explorer and Bing the following: windows server 2012 Error : 0x800f0906. The first result (when I searched) was titled “Error codes when you try to install the .NET Framework 3.5 in Windows 8 or in Windows Server 2012” and the support article can be found at http://support.microsoft.com/kb/2734782. The specific resolution to solve our issue is in this support article. We need to re-run our PowerShell command but this time include the –source parameter specifying a specific the location within the Windows Server 2012 installation media. As an easy example, if your Windows Server 2012 installation media (ISO) is mounted to your D: drive, then the path to provide in the –Source parameter is: D:\sources\sxs. Now we know how to install the SharePoint 2013 Roles/Features Prerequisites successfully in an offline Windows Server 2012 environment.
To install the Roles/Features required by SharePoint 2013 on Windows Server 2012 in an offline environment, you need to have access to the Windows Server 2012 installation media.
For the purposes of example, assume you have mounted the Windows Server 2012 installation media (ISO) to the D: drive of the server. Please note that you can also copy the files locally or specify a UNC path where the installation files are stored. You need to specify
Open an elevated PowerShell prompt (i.e. Run as Administrator) and execute the following:
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 –Source D:\sources\sxs
Your server will require a reboot after running this PowerShell code.
SharePoint 2013 requires the following Prerequisites to be installed on Windows Server 2012 prior to installing SharePoint 2013. The following is a complete list of the Prerequisites along with their download links. Please note that .NET 4.5 and Windows Management Framework 3.0 are also prerequisites and have been intentionally omitted from this list as they are both installed by default on Windows Server 2012.
Obviously you need to download these from the Internet. This is the only portion of this deep dive that can’t be done offline. You’ll need to copy/save these into a location accessible to the SharePoint 2013 Prerequisite installer. See the next section for more details regarding their installation.
For a TechNet reference to the PrerequisiteInstaller.exe and its switches, see http://technet.microsoft.com/en-us/library/ff686793.aspx.
For the purposes of example, let’s assume the following:
Based on the scenario outlined above you can execute the following PowerShell code (at an elevated prompt, i.e. Run as Administrator) to install the prerequisites. Make sure the second line is all on one line.
$SharePoint2013Path = "c:\sharepoint2013bits"
Start-Process "$SharePoint2013Path\PrerequisiteInstaller.exe" –ArgumentList "/SQLNCli:$SharePoint2013Path\PrerequisiteInstallerFiles\sqlncli.msi /IDFX:$SharePoint2013Path\PrerequisiteInstallerFiles\Windows6.1-KB974405-x64.msu /IDFX11:$SharePoint2013Path\PrerequisiteInstallerFiles\MicrosoftIdentityExtensions-64.msi /Sync:$SharePoint2013Path\PrerequisiteInstallerFiles\Synchronization.msi /AppFabric:$SharePoint2013Path\PrerequisiteInstallerFiles\WindowsServerAppFabricSetup_x64.exe /KB2671763:$SharePoint2013Path\PrerequisiteInstallerFiles\AppFabric1.1-RTM-KB2671763-x64-ENU.exe /MSIPCClient:$SharePoint2013Path\PrerequisiteInstallerFiles\setup_msipc_x64.msi /WCFDataServices:$SharePoint2013Path\PrerequisiteInstallerFiles\WcfDataServices.exe"
When you execute this the Microsoft SharePoint 2013 Products Preparation Tool will appear. Follow the prompts and your Prerequisites will install.
Note that even if you are installing these Prerequisites on a server that is Online, using this procedure will be faster due the fact that the Prerequisites are available locally and don't need to be downloaded.
I have uploaded scripts to the TechNet Gallery to serve as an assistant to installing the SharePoint 2013 Prerequisites on Windows Server 2012 - these scripts make it easy for you.
Download/Install SharePoint 2013 Prerequisites on Windows Server 2012 - http://gallery.technet.microsoft.com/DownloadInstall-SharePoint-e6df9eb8
There are three scripts in this TechNet Gallery download that achieve the following goals:
Ed Price - MSFT edited Revision 22. Comment: Minor edit - Spacing in title
Richard Mueller edited Revision 20. Comment: Replace RGB values with color names in HTML to fix colors
Richard Mueller edited Revision 19. Comment: Remove blank headings and fix duplicate <a name> tags in HTML
Gokan Ozcifci edited Revision 17. Comment: Add Best Practices
Doug Hemminger edited Revision 16. Comment: One small formatting fix to the code blocks
Doug Hemminger edited Revision 15. Comment: Did a small amount of formatting (line breaks, spacing, code blocks, etc) and fixed a couple of very minor grammar issues.
Richard Mueller edited Revision 14. Comment: Eliminate duplicate entry in the TOC
Richard Mueller edited Revision 13. Comment: Fix TOC <a name> tags
Richard Mueller edited Revision 12. Comment: Fix zeros in <a name> tags in headings in HTML to clean up
Craig Lussier edited Revision 10. Comment: modified formatting
Craig Lussier edited Original. Comment: edited html code
Craig Lussier edited Revision 1. Comment: modified text
Craig Lussier edited Revision 2. Comment: added links
Craig Lussier edited Revision 4. Comment: edited toc and title
Craig Lussier edited Revision 5. Comment: edited toc
Craig Lussier edited Revision 6. Comment: added link