How to Rebuild Broken OWA Farm in 3 PowerShell Steps

C
Collab365 TeamAuthorPublished Dec 23, 2016
6

At a Glance

Target Audience
SharePoint Administrators, OWA Server Managers
Problem Solved
Windows automatic updates remove OWA server from farm, causing empty machines list, werfault.exe CPU spikes, and document open failures.
Use Case
Troubleshooting single-server OWA farms in on-premises SharePoint after patches.

Most IT teams leave automatic updates turned on because they think it keeps their infrastructure safe. It usually does. But if you run Office Web Apps (OWA), it is a ticking time bomb.

You forget OWA even exists until a user complains they cannot open a document. You log into the server to investigate. The CPU is pegged at 100%. You open Task Manager and see an endless wall of Werfault.exe processes eating every cycle available.

Werfault.exe is just Windows Error Reporting trying to handle a systemic crash. The problem is that OWA farm issues cause it to flood the CPU. The server is essentially screaming in pain.

First, you need to stop the bleeding. Open PowerShell and kill those reporting processes so you can actually type.

Get-Process -Name werfault | kill

Now you can check the farm status.

Import-Module OfficeWebApps
Get-OfficeWebAppsFarm

This is where the nightmare becomes obvious. You get a warning stating the machine does not appear to be part of an Office Web Apps server farm. You look down the output and see that the Machines list is completely empty.

Machines : {}

OWA did not break the server. Windows Update broke OWA.

When an update applies to an OWA server, it automatically removes that machine from the farm. If you run a single-server farm, you are stuck. You cannot just run New-OfficeWebAppsMachine to add it back because that command requires at least one healthy machine already in the farm.

So how do you fix it? You rebuild the farm from scratch.

Since your IIS and SharePoint configurations are still intact, you just need to recreate the farm using your original parameters.

New-OfficeWebAppsFarm -InternalUrl "http://yourURL" -ExternalUrl "http://yourURL" -EditingEnabled -AllowHttp:$true

Adjust the HTTP or HTTPS settings to match what you had before. Once you run this, testing should confirm everything is back online.

The real fix is process. Stop letting your servers manage themselves. Microsoft explicitly states that applying updates via the automatic updates process is unsupported.

Turn off automatic updates for your OWA servers immediately. Read the official documentation here: http://technet.microsoft.com/en-us/library/jj966220.