Opening browser-enabled documents
Browser-enabled documents can be opened in the browser or the client application. This commonly applies to office documents if Office Web Apps is configure or browser enabled InfoPath forms.
You can control how browser-enabled documents opens by default for individual document libraries by going to Document Library -> Settings -> Advanced Settings and changing the “Default open behavior for browser-enabled documents”.
But what if you have several Document Libraries and you want to change this setting for every Document Library in the site? Users can change this setting in the document library properties, and site collection administrators can change this setting in Site Collection Administration or by using the Install-SPFeature cmdlet to install the OpenInClient feature.
So bottom line here is there is no way I can think of to just update all the Document Library to change this setting globally at a sub site level.
PowerShell to the Rescue
Here is short PowerShell script that takes three parameters.
- -SiteURL URL of the SharePoint Site Collection or Sub Site
- -OpenIn “PreferClient” or “Browser”
- -DocumentLibrary “All” or “Name of the Document Library”
This will iterate through all the Document Libraries of that particular Web (won’t cycle through any of the subsites) and update the “Default Open In” behavior based on the value passed for -OpenIn parameter. If the value “PreferClient” then the setting is changed to “Open in client application” and if the value is “Browser” then the setting is changed to “Open in client browser”.
You can download the source code here.
Please note that the “System Libraries” section is not exhaustive, so you should test this in a development environment and review libraries you want to skip and add it to the exception list.