How to Disable “Open with Explorer” View in SharePoint 2013?

Requirement: Got a requirement to hide “Open with Explorer” button from a particular library’s ribbon menu due to some security reasons.

Solution: Open with Explorer button can be disabled in multiple approaches.

  1. Disable “Client Integration” from Web Application’s Authentication Providers.
  2. Remove permissions “Use Remote Interfaces” which also removes “Use Client Integration Features” from permission levels.
  3. Edit the “CustomDefalutTemplates.ascx” file located at: C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\TEMPLATE\CONTROLTEMPLATES. Find and Replace PermissionString from “UseClientIntegration” to PermissionString=”MangeWeb” of nodes with ID “OpenInExplorer”
  4. CSS/JavaScript-jQuery methods to Turn-Off explorer view.
  5. Create a custom action with EMPTY CommandUIDefinition, so that it overrides existing ribbon button.

Let’s stick with the last one!

Add Custom Action to Hide “Open with Explorer”

While any ribbon button, group, a tab can be hidden by overriding the specific custom action using Visual Studio based solution as in How to Hide SharePoint 2010 Ribbon Button, Group, Menu, Tab, Here I’m using PowerShell to add/remove custom action to hide Open with Explorer view in SharePoint 2013.

disable open with explorer in sharepoint 2013

Add a custom action to disable the Open with Explorer button in SharePoint 2016:

Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

#Variables
$SiteUrl="http://operations.crescent.com/Monitoring" 
$ListName = "2015 Documents"

#Get Web and List objects
$web = Get-SPWeb $SiteURL
$list = $web.Lists[$ListName]

#Add an empty Custom Action to Override default custom action
$CustomAction = $list.UserCustomActions.Add()

$CustomAction.Title = "Hide Explorer View"
$CustomAction.Location = "CommandUI.Ribbon"
$CustomAction.commandUIExtension = "
            <CommandUIExtension> 
               <CommandUIDefinitions> 
                     <CommandUIDefinition 
                             Location='Ribbon.Library.Actions.OpenWithExplorer' /> 
                     </CommandUIDefinitions>
              </CommandUIExtension>" 

$CustomAction.Update();

write-host "Custom Action has been added successfully!"

Our Output!
hide open with explorer button in SharePoint 2013

Delete the custom action from the list:

Let’s remove the custom action we’ve created to hide Open with Explorer button.

Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

#Variables
$SiteUrl="http://operations.crescent.com/Monitoring" 
$ListName = "2015 Documents"
$CustomActionTitle = "Hide Explorer View"

#Get Web and List objects
$web = Get-SPWeb $SiteURL
$list = $web.Lists[$ListName]

#Get the custom action
$CustomAction = $list.UserCustomActions | where {$_.title -eq $CustomActionTitle} 

#Delete the custom action from list
if ($CustomAction)
{
    $CustomAction.Delete()
}

You can also remove a custom action from the SharePoint list via SharePoint designer, as in the below screen:
remove custom action from sharepoint designer 2013

Salaudeen Rajack

Salaudeen Rajack is a SharePoint Architect with Two decades of SharePoint Experience. He loves sharing his knowledge and experiences with the SharePoint community, through his real-world articles!

3 thoughts on “How to Disable “Open with Explorer” View in SharePoint 2013?

  • December 20, 2019 at 3:53 AM

    can it work for sharepoint online?

    Reply
  • November 8, 2016 at 3:01 PM

    many thanks! it’s working very good!!!

    Reply

Leave a Reply