3

I am trying to disable Office WebApps for one web application using below powershell:

How does one disable Office Web Apps for a given Site Collection or Web Application?

$webAppsFeatureId = $(Get-SPFeature -limit all | where {$_.displayname -eq "OfficeWebApps"}).Id 
$singleSiteCollection = Get-SPSite -Identity http://servername:port
Disable-SPFeature $webAppsFeatureId -Url $singleSiteCollection.URL

But I am getting below error:

Disable-SPFeature : Cannot convert 'System.Object[]' to the type 'Microsoft.SharePoint.PowerShell.SPFeatureDefinitionPipeBind' required by parameter 'Identity'. Specified method is not supported. At line:1 char:19 + Disable-SPFeature $webAppsFeatureId -Url $singleSiteCollection.URL + ~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidArgument: (:) [Disable-SPFeature], Parame terBindingException + FullyQualifiedErrorId : CannotConvertArgument,Microsoft.SharePoint.Power
Shell.SPCmdletDisableFeature

How to resolve that? or is there any other way to disable Office WebApps for particular web application?

2

Unfortunately you can't disable Office Web Apps on a web application. It's the farm that has exchanged trust with the Office Web Apps farm.

What you do instead is to enable a site collection feature called OpenInClient. By this you force documents to open in client applications (Word, Excel,...) without removing access to Office Web Apps. And (as always) there is a script for that operation:

Enable-SPFeature 8A4B8DE2-6FD8-41e9-923C-C7C3C00F8295 -url <SiteCollURL>

Or for all sites

Get-SPSite -limit ALL |foreach{ Enable-SPFeature 8A4B8DE2-6FD8-41e9-923C-C7C3C00F8295 -url $_.URL }

Reference: Set the default open behavior for browser-enabled documents (Office Web Apps when used with SharePoint 2013)

PDF

To adjust the binding so that smartphones won’t try to view PDFs in Word Web App (but other devices will continue to), enter the following command and then press Enter:

Get-SPWopiBinding -Action "MobileView" -Application "WordPDF" | Remove-SPWopiBinding -Confirm:$false

To remove the binding altogether so that PDFs open in the default PDF viewer on all devices, use the following:

Get-SPWOPIBinding –Application "WordPDF" | Remove-SPWOPIBinding -Confirm:$false

Reference: Control whether PDFs open in Word Web App or the default PDF reader

  • Hi Benny, I activated OpenInClient feature, now word and excel get opened in client application, but pdf file still opens in Word web app. How to restrict that? – P S Sep 1 '16 at 9:56
  • @PS Ah, I forgot that. See my updated answer :) – Benny Skogberg Sep 1 '16 at 10:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.