Thursday, 16 February 2017

How to set the default open behaviour or Configure Office files open by default in SharePoint online

How to set the default open behavior or Configure Office files open by default in SharePoint online
This article is about “How to set the default open behavior or Configure Office files open by default in SharePoint online” in SharePoint site collection or in document library.
I will explains how can we configure the default open behavior for Office documents (browser or Application) in SharePoint site collections and document libraries.
This solution article will applies to SharePoint online, SharePoint Server 2013, SharePoint Foundation 2013, and Office Web Apps.
So let’s start with small description about set how document behavior will be there in browser, as we know we are creating document library to store the documents like word, excel, PPT and etc.. by default after configure the SharePoint server clicking on any of document will get open and behavior to open any of those file will set as Use server default (Open in browser) PDF documents open in the Word Web App.
We can do setup the same three different ways:
  • SharePoint Farm (farm based we can configure)
  • Site collection (Can be configured on site collection)
  • Document Library (one document library also can be configured the same)
In the SharePoint Farm: we can configure or adjust the default open behavior of file per file types basis; example: Word, excel or notebook and PDF behavior as well.
To do the above we need to run a command called New-SPWOPIBinding this command will Creates a new binding to associate file name extensions or applications with actions on the current SharePoint farm where this cmdlet is run.
The New-SPWOPIBinding cmdlet associates file name extensions or applications to actions on the current SharePoint farm where this cmdlet is run.
Syntax: New-SPWOPIBinding -ServerName "Prashant.spsolutions.com"
Above example creates bindings for all the applications and file name extensions that the WOPI application supports on the current SharePoint farm where this cmdlet is run.
For specific application we can run below command:
New-SPWOPIBinding -ServerName "Server.corp.Contoso.com" -Application "Excel"
To get more about farm based changes for office file behaviour, visit below URL:
Don’t get confuse about, once you have configured farm based settings for office files, later we can remove also so may there will be a lot of question on the same, so kindly do visit the above URL and there sub added site you will get all details from the same.
We have another option to change the behaviour in site collection itself:
Setup Office file behaviour in Site collection: SP administrators and users can use the OpenInClient feature in SharePoint online or 2013 to specify whether Office (Word, excel etc…) files will be opened in the client application or in the browser. Users (who have permission) can change this setting in the document library properties also for site collection administrators can change it in Site Collection Administration or by using the Enable-SPFeature cmdlet to enable the OpenInClient feature.
Below are the step by step solution with screen shots to the same:
Note: I am going to perform this on SharePoint Online, same steps will for SharePoint on-premises with some different GUI mode.
  • Login to the SharePoint online site collection with admin rights.
  • Navigate the page to Site setting by clicking on Gear box on the top of page and Site collection features from site collection administrator, see below
  • Now click on highlighted site collection features and activate Open documents in client application by default.
  • By default it will be deactivate so just click on activate wait for activation
  • Once all done, go back to any of document library and open document see the result, earlier it was opening in browser now it will prompt to ask Application which you want to use.
We can configure the above by using PowerShell command as well;
  • Open SharePoint Online Management Shell and run below command
Connect-SPOService -Url https://Spsolutions.sharepoint.com -credentialPrashant@spsolutionsonmicrosoft.com
  • Once entered hit enter, it will prompt us for password enter the password and wait a second, it will connect your Office 365 site.
Note: Make sure you have admin rights to follow the steps, or else you will be getting an error called access denied or not authorised.
  • Now on the connected office 365 site, run below command
Enable-SPFeature 8A4B8DE2-6FD8-41e9-923C-C7C3C00F8295 -url <SiteCollURL (enter your site URL>
The above command is to activate the feature for one site URL, if you wish to enable to same features for all site URL we need to run below command:
Get-SPSite -limit ALL |foreach{ Enable-SPFeature 8A4B8DE2-6FD8-41e9-923C-C7C3C00F8295 -url $_.URL }
At the last point:
Set the default open behaviour for a document library by using the document library settings page:
This is very simple to do for one particular document library, we can set behaviour for office document in one document library as well, and it will take effect for all document available in the same.
  • Open one document Library and move your mouse cursor to Documents ribbon.
  • As SharePoint online is keep changing view, in the experienced view we can click on site setting and select document settings option, see below
  • Once select Library settings it will take us to setting page, default view classic. Here we need to scroll down the page and select open document in browser option and select as you wish to open your file.
  • Here we can see default, use the server default (open in the browser), so here we need to select other option like open in the client application and save this settings.
  • Now go back to Library page and open any one document and see the behaviour is as expected or not? In my case I have done
  • We can configure the same with Office 365 PowerShell management shell also, below is the command:
Get-SPWeb -site <SiteCollURL> | % {$_.Lists} | where {$_.IrmEnabled -eq $true} | % {$_.DefaultItemOpen =[Microsoft.Sharepoint.DefaultItemOpen]::<DefaultItemOpenSetting>; $_.Update()}
*Change site coolection URL on the coloured object.

Thanks 

No comments:

Post a Comment