SharePoint 2013: Install Prerequisites Offline or Manually on Windows Server 2012 - A Comprehensive Guide

SharePoint 2013: Install Prerequisites Offline or Manually on Windows Server 2012 - A Comprehensive Guide

Introduction

This post is intended to be a how-to guide and provide comprehensive insight into the ‘offline’ SharePoint 2013 Prerequisite installation process on Windows Server 2012. You can also consider this to be a ‘manual’ procedure. This post contains an at length description of the issues you potentially will encounter, and the resolutions to these issues.

This procedure applies specifically to a default install of Windows Server 2012 (Standard or Datacenter edition)

Jump right to the solutions

As this is a lengthy article, the following links will bring you right to the solutions:


What do I need to successfully install the Prerequisites?

  • A server with the 64-bit Windows Server 2012 installed (Standard or Datacenter edition) upon which you intend to install SharePoint 2013
  • SharePoint 2013 installation media
  • Windows Server 2012 installation media

Why is attention to an Offline or Manual Prerequisites installation important?

Out of the box, the Prerequisiteinstaller.exe requires an Internet connection (i.e. the server is ‘Online’) to successfully complete the installation. If you attempt to use the out of the box PrerequisiteInstaller.exe on a Windows 2012 server without an Internet connection, the installation will fail.

 

Identifying all the Prerequisites for Windows Server 2012

Here are the Prerequisite items applicable to Windows Server 2012. I am breaking them down into three separate groups of Prerequisites for easy identification in relation to how the PrerequisiteInstaller.exe will identify and install the Prerequisites:
  1. Prerequisites that should be installed by default (among other things, the installer will check for and verify their presence)    
    1. Microsoft .NET Framework 4.5
    2. Windows Management Framework 3.0

     

  2. Next are the Roles/Features that are required for the “Application Server Role, Web Server (IIS Role)”. It turns out that this is a long list of Roles/Features - 46 in total. Further into this post, I’ll show you how to get this list while the Prerequisites are installing using the out of the box PrerequisiteInstaller.exe. Within an elevated (i.e. Run as Administrator) PowerShell prompt, you can use Get-WindowsFeature to see all of the Roles/Features installed on your server and map the Roles/Features in the table below to the labels used within the Add Roles/Features Windows Wizard.

    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

     

  3. Prerequisites that must be downloaded and installed:

    1. Microsoft SQL Server 2008 R2 SP1 Native Client
    2. Microsoft Sync Framework Runtime v1.0 SP1 (x64)
    3. Windows Server AppFabric
    4. Cumulative Update Package 1 for Microsoft AppFabric 1.1 for Windows Server (KB2671763)
    5. Windows Identity Foundation (KB974405)
    6. Microsoft Identity Extensions
    7. Microsoft Information Protection and Control Client
    8. Microsoft WCF Data Services 5.0

 

Prerequisite Installation issues you may encounter in an Offline environment

 

Issues with the PrerequisiteInstaller.exe when executed Offline

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.

Issues with using PowerShell to install Roles and Features when executed Offline

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.

  • This will fail if the Windows Server 2012 server is offline
  • This will not fail if the Windows Server 2012 server is online
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:

  • "The source files could not be downloaded" – we know this because the server is offline.
  • "Use the 'source' option to specify the location of the files that are required to restore the feature"
  • Error code 0x800f0906.

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.

 

Solutions - Offline and Manual Prerequisite Procedures

 

Installing the Roles and Features for SharePoint 2013 on Windows Server 2012 Offline with PowerShell

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:

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 –Source D:\sources\sxs

 

Your server will require a reboot after running this PowerShell code.

Downloading the SharePoint 2013 Prerequisite files for Offline Installation

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.

 

Installing the Downloaded Prerequisite files for SharePoint 2013 on Windows Server 2012 using PrerequisiteInstaller.exe

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:

  • You have the SharePoint 2013 installation media copied locally within Windows Server 2012 at c:\sharepoint2013bits.
  • You have copied the downloaded Prerequisite files to the c:\sharepoint2013bits\PrerequisiteInstallerFiles folder. (See the previous section regarding which files to download)
  • As a note – if you have multiple SharePoint 2013 servers to build, you will be better off placing the SharePoint 2013 installation files on a network share. In addition, you should also copy the downloaded prerequisite files to the location specified above within SharePoint 2013 installation media prerequisiteinstallerfiles directory on said network share. This will make your life easier. Although this example uses local paths, UNC paths on a network share are fully supported as long as the logged in user installing the prerequisites has read rights to the UNC network path location.

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.

 

PowerShell Scripts available to automate the offline and manual Download and Installation Process

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:

  • Install-SP2013RolesFeatures.ps1 - Installs the Prerequisites using the PowerShell outlined in this article
  • Download-SP2013PreReqFiles.ps1 - Automates the download of the required prerequisites as described in this article
  • Install-SP2013PreReqFiles.ps1 - Installs the downloaded Prerequisite files as described in this article   

See Also