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 
$singleSiteCollection = Get-SPSite -Identity http://
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:

 

 

 

     

     

     

     

     

     



     
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:

 

 

 

 




 
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.

By Indra

SharePoint Architect

Leave a Reply