Disable Mobile Browser View Across Sites In SharePoint Server 2016

Device channels were introduced in SharePoint 2013. Device channel allows us to map the created device channel to a device, based on its user agent and target custom master pages, specifically to the device. Thus,  we can have one master page for iPhone while a different one for Blackberry and so on.

sharepoint

However, when we try to specify a master page for the device channel, we will get the below warning if Mobile Browser view is not disabled.

sharepoint

We can disable Mobile Browser View feature across the sites in a site collection by running the below script in SharePoint 2016 Management Shell.
  1. $SPWebApplication = Get - SPWebApplication - Identity "http://SharePoint2016"  
  2. $SPSiteCollection = $SPWebApplication | Get - SPSite - limit all  
  3. foreach($SPSite in $SPSiteCollection) {  
  4.     $SPWebs = $SPSite | Get - SPweb - limit all  
  5.     foreach($SPWeb in $SPWebs) {  
  6.         Disable - SPFeature - Identity "d95c97f3-e528-4da2-ae9f-32b3535fbb59" - url $SPWeb.URL - Confirm: $False - ErrorAction SilentlyContinue  
  7.     }  
  8. }  
sharepoint

Heading over to the Features section, we can see that the Mobile Browser View has been disabled.

sharepoint

Now, we can successfully specify the master page for device channel, as shown below.

sharepoint
Summary

Thus, we saw how to disable Mobile Browser View for sites across the site collection in SharePoint Server 216