Wednesday, July 30, 2014

SharePoint 2013: How to Rebuild an OWA farm

Introduction

This posting walks through the process of rebuilding Office Web App (OWA) services for a SharePoint 2013 farm.  Rebuilding an OWA farm is simple and quick and is sometimes the most efficient method for recovering from severe errors or service failures. 

This posting assumes a single-server internal OWA farm that exposes its service over HTTP (not HTTPS) for an internal corporate environment and that has Microsoft Office volume licensing.  It also assumes an internal SharePoint 2013 farm that uses authentication over HTTP and does not employ encrypted connections.

Procedure
  1. Remove SharePoint Bindings
    1. Login to any server in the farm that hosts SharePoint 2013, using the Setup User Administrator account (eg, spAdmin).
      NOTE: always use the SharePoint Setup User Administrator account for any SharePoint installation and configuration activities.
    2. Open a SharePoint Management Shell with elevated privileges (as administrator).
    3. Execute the following:
      Remove-SPWOPIBinding -All:$True
      This removes the Office application bindings that SharePoint has to the OWA server.
    4. Logout of the SharePoint server.
  2. Remove the OWA server from the farm
    1. Login to the OWA server using an administrator account (no need to use the SharePoint Admin account - this is not really a SharePoint server).
    2. Open a PowerShell window with elevated privileges (as administrator).
    3. Execute the following:
      Import-Module -Name OfficeWebApps
      Remove-OfficeWebAppsMachine
      This doesn't uninstall the OWA software; it only removes the local OWA server from the OWA farm.
      NOTE: if you have more than one OWA server in the OWA farm, you must first execute this command on each of the child OWA servers first. Then you can execute this command on the final, master OWA server.
    4. Remain logged onto the OWA server.  There's still one more thing to do.
  3. Re-build the OWA Server
    1. Uninstall the software using standard Windows uninstallation method.
      NOTE: you must uninstall the OWA software and rebuild fresh due to how the updates were previously installed. Uninstalling the OWA software will also get rid of the updates.
    2. Restart the OWA server.
    3. Logon using an administrator account (no need to use the SharePoint Admin account).
    4. Re-install OWA.
    5. Re-install updates.
    6. Restart the OWA server.
  4. Re-build the OWA farm
    1. Login to the OWA server again using an administrator account.
    2. Open a PowerShell window with elevated privileges (as administrator).
    3. Execute the following:
      Import-Module -Name OfficeWebApps
      New-OfficeWebAppsFarm -InternalURL "http://servername" -AllowHttp -EditingEnabled
      where servername is the actual name of the OWA server host machine. Do not use the fully qualified name. Executing this command builds a new OWA farm.
    4. Next, execute the following:
      Get-OfficeWebAppsMachine
      This returns the Roles and health status of the local OWA server. For my OWA farm, I wanted the roles to be All and health status Healthy
      NOTE: if the status returned is Unhealthy, verify that the HTTP-Activation feature has been added for both .NET 3.5 and .NET 4.5.  If not, add these features and then check status again.  It may take afew minutes for this feature change to have an affect.
    5. Logout of the OWA server.
    6. Open any browser on your desktop machine (assuming it can connect to the OWA server), and then connect to the following:
      http:/servername/hosting/discovery
      If everything's working correctly, you will see the service discovery file in XML format.
    7. Close the browser.
  5. Add SharePoint Bindings
    1. Login to any SharePoint farm server (ie, hosting SharePoint) using your farm's SharePoint Setup User Administrator account.
    2. Open a SharePoint Management Shell with elevated privileges (as administrator).
    3. Execute the following:
      Get-SPWOPIBinding
      This should return nothing, since all WOPI bindings should have been removed back in step 3. If it doesn't, execute Remove-SPWOPIBinding.
    4. In this same SharePoint Management shell, execute the following:
      New-SPWOPIBinding -ServerName <WacServerName> -AllowHTTP
      where ServerName is the actual name of the OWA server host machine. Do not use the fully qualified name. This command builds the bindings in SharePoint to the OWA service application.
    5. In this same SharePoint Management shell, execute the following:
      Get-SPWOPIBinding
      This should now return a list of Office applications and actions and their bindings.
    6. In the same SharePoint Management shell, execute the following:
      Get-SPWOPIZone
      This should return internal-http, given the WOPI authentication type that was configured in step 22, "-AllowHTTP."
    7. In the same SharePoint Management shell, execute the following:
      (Get-SPSecurityTokenServiceConfig).AllowOAuthOverHttp
      This should return True, if you are not using HTTPS for connections to your farm.
    8. OWA services should be available immediately, and you can test right away.
References

No comments: