Uninstall or Disable Office Web Apps?

Although there’s very small chance for people to decide to disable/uninstall Office Web Apps from their farm, sometimes this is still required, for example if customer has licensing issues.

When Chris Givens was working on 10174 training course he noticed that the uninstall did not go smoothly as he thought. I was working with him and reviewing the content as the content owner from a Product Manager’s perspective, and got notified as well. However a lot of things happened afterwards so I didn’t have time to look at it until now.

Here’re a few points you must remember when you want to uninstall Office Web Apps:

  • Uninstall Office Web Apps will remove the server from the SharePoint Farm. If you read the notification carefully when you click the uninstall button you will know this.
  • All web applications and sites created by SharePoint will be deleted from IIS.
  • You can rejoin the machine back to the Server Farm by psconfig with your farm passphrase.
  • You need to redeploy customizations to the server.
  • If this happens to be the server which hosts Central Administration, you need to rebuild the CA. This can be done through the Management Shell: New-SPCentralAdministration -Port xxxx -WindowsAuthProvider "NTLM"

If you can tolerance server down time then maybe it’s fine for you. Otherwise the whole process are not that pleasant. So how about just disable it like this:https://technet.microsoft.com/en-us/library/ee837418.aspx ?

To deactivate the Office Web Apps Feature on a single site collection by using Windows PowerShell

Using Notepad, open a new text file and then copy and paste the following script into the file.

  $webAppsFeatureId = $(Get-SPFeature -limit all | where {$_.displayname -eq "OfficeWebApps"}).Id <br>$singleSiteCollection = Get-SPSite -Identity https://<site_name> <br>Disable-SPFeature $webAppsFeatureId -Url $singleSiteCollection.URL

Hmm, in fact this will not completely disable the feature. You have to enable “Open in Client” feature as well, then all files can be opened in Office clients instead of the browser. However if you visit the server without Office client installed or using something like Safari/Chrome, you will still be redirected to the Office Web Apps page like WordViewer.aspx even you have deleted the service applications, stopped the related services.

Why? Because the modification to the drop down menu and open behavior by Office Web Apps cannot be turned off using those ways. Of course, a full uninstall will work – but like what I listed above, it has many cons. Luckily this is not the end of the world. With a few hours work I identified the change made by Office Web Apps and confirmed with the product team. Here’s my findings:

The reason why you can see those drop down menus with items like “Edit in Browser” is because the XML definition is changed. Take this one as an example:

c:\program files\common files\microsoft shared\web server extensions\14\template\xml\serverfilesword.xml

Content:

<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright (c) Microsoft Corporation. All rights reserved. -->
<ServerFiles>
    <Mapping FileExtension="doc"  RedirectUrlTemplate= "/_layouts/WordViewer.aspx?id=|0" NoGetRedirect="TRUE" />
    <Mapping FileExtension="dot"  RedirectUrlTemplate= "/_layouts/WordViewer.aspx?id=|0" NoGetRedirect="TRUE" />
    <Mapping FileExtension="docx" RedirectUrlTemplate= "/_layouts/WordViewer.aspx?id=|0" NoGetRedirect="TRUE" CreateRedirectUrlTemplate= "/_layouts/CreateNewDocument.aspx?id=|0" />
    <Mapping FileExtension="docm" RedirectUrlTemplate= "/_layouts/WordViewer.aspx?id=|0" NoGetRedirect="TRUE" CreateRedirectUrlTemplate= "/_layouts/CreateNewDocument.aspx?id=|0" />
    <Mapping FileExtension="dotx" RedirectUrlTemplate= "/_layouts/WordViewer.aspx?id=|0" NoGetRedirect="TRUE" CreateRedirectUrlTemplate= "/_layouts/CreateNewDocument.aspx?id=|0" />
    <Mapping FileExtension="dotm" RedirectUrlTemplate= "/_layouts/WordViewer.aspx?id=|0" NoGetRedirect="TRUE" />
</ServerFiles>

The purpose of this file is to tell SharePoint that if it has such doc files within a doc lib, use the redirect url template to process it. So what we will do is to simply remove this file or comment out the section to make it looks like this:

<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright (c) Microsoft Corporation. All rights reserved. -->
<ServerFiles>
<!--
    <Mapping FileExtension="doc"  RedirectUrlTemplate= "/_layouts/WordViewer.aspx?id=|0" NoGetRedirect="TRUE" />
    <Mapping FileExtension="dot"  RedirectUrlTemplate= "/_layouts/WordViewer.aspx?id=|0" NoGetRedirect="TRUE" />
    <Mapping FileExtension="docx" RedirectUrlTemplate= "/_layouts/WordViewer.aspx?id=|0" NoGetRedirect="TRUE" CreateRedirectUrlTemplate= "/_layouts/CreateNewDocument.aspx?id=|0" />
    <Mapping FileExtension="docm" RedirectUrlTemplate= "/_layouts/WordViewer.aspx?id=|0" NoGetRedirect="TRUE" CreateRedirectUrlTemplate= "/_layouts/CreateNewDocument.aspx?id=|0" />
    <Mapping FileExtension="dotx" RedirectUrlTemplate= "/_layouts/WordViewer.aspx?id=|0" NoGetRedirect="TRUE" CreateRedirectUrlTemplate= "/_layouts/CreateNewDocument.aspx?id=|0" />
    <Mapping FileExtension="dotm" RedirectUrlTemplate= "/_layouts/WordViewer.aspx?id=|0" NoGetRedirect="TRUE" />
-->
</ServerFiles>

Then do the same to serverfilespowerpoint.xml. Unless you are using standard CAL, there’s no need to touch Excel Services since it’s a part of Enterprise CAL and is not installed by Office Web Apps.

Then combine this change with the disable of Office Web Apps feature and the enable of Open in Client feature, Office Web Apps can be disabled completely on the site collection from a user experience perspective. You can also stop the related services and service applications.

 

Jie.