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.
Add Custom Action to Hide Open with Explorer:
While any ribbon button, group, 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.

Add custom action to disable Open with Explorer button in SharePoint 2013:
and our Output!
Delete the custom action from list:
Lets remove the custom action we've created to hide Open with Explorer button.
You can also remove a custom action from SharePoint list via SharePoint designer, as in below screen:

You might also like:
*Sponsored
Solution: Open with Explorer button can be disabled in multiple approaches.
- Disable "Client Integration" from Web Application's Authentication Providers.
- Remove permissions "Use Remote Interfaces" which also removes "Use Client Integration Features" from permission levels.
- 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"
- CSS/JavaScript-jQuery methods to Turn-Off explorer view.
- Create a custom action with EMPTY CommandUIDefinition, so that it overrides existing ribbon button.
Add Custom Action to Hide Open with Explorer:
While any ribbon button, group, 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.

Add custom action to disable Open with Explorer button in SharePoint 2013:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
| Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue#Variables$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!" |

Delete the custom action from list:
Lets remove the custom action we've created to hide Open with Explorer button.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
| Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue#Variables$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 listif ($CustomAction){ $CustomAction.Delete()} |
You can also remove a custom action from SharePoint list via SharePoint designer, as in below screen:

You might also like:
| SharePoint Usage Reports Usage reports, collaboration and audit for SharePoint. | Five Challenges in SharePoint Security ...And How to Solve Them. Free White Paper |
Saturday, March 7, 2015
"Upgrade Required" Status in SharePoint 2013 Central Administration Servers in Farm
Getting "Upgrade Required" error message in SharePoint 2013? Well, Ideally, We have to run the SharePoint Products Configuration Wizard on the server(s) right after installing the service pack/patches.
In Windows Server 2012, SharePoint updates are part of Windows Server Update. It installs patches but never runs Products configuration wizard automatically! You still have to run psconfig wizard to complete patching!
SharePoint Patching is a two-step process:

If you get any errors while running psconfig, the next step is to force SharePoint upgrade with this command line:
psconfig.exe -cmd upgrade -inplace b2b -force -cmd applicationcontent -install -cmd installfeatures
To apply patches on SharePoint 2013, Follow my step by step guide at: SharePoint 2013 Patching Guide - Step by Step
You might also like:
*Sponsored
In Windows Server 2012, SharePoint updates are part of Windows Server Update. It installs patches but never runs Products configuration wizard automatically! You still have to run psconfig wizard to complete patching!
SharePoint Patching is a two-step process:
- Install the patch binaries
- Run psconfig wizard manually.

If you get any errors while running psconfig, the next step is to force SharePoint upgrade with this command line:
psconfig.exe -cmd upgrade -inplace b2b -force -cmd applicationcontent -install -cmd installfeatures
If you are using SQL aliases, make sure its configured in Every SharePoint server!
To apply patches on SharePoint 2013, Follow my step by step guide at: SharePoint 2013 Patching Guide - Step by Step
You might also like:
| SharePoint Usage Reports Usage reports, collaboration and audit for SharePoint. | Five Challenges in SharePoint Security ...And How to Solve Them. Free White Paper |
You might also like:
SharePoint 2013 Patch (Service Pack-CU-Hotfix) Installation ...
Migrate from SharePoint 2010 to SharePoint 2013 - Step by ...
SharePoint Configuration wizard stuck and never ending when ...
Do not delete Files in "C:\Windows\installer" On SharePoint ...
PSConfig Wizard Configuration Failed: An Update Conflict ...
Wednesday, February 18, 2015
How to Hide Share, Follow and Sync Buttons in Sharepoint 2013
We got a requirement to remove Share, Follow and Sync buttons in SharePoint 2013. Let me summarize various ways to disable these buttons.

How to disable "Share" button in SharePoint 2013?
Share button is relying on "Access requests" configuration of the site. To disable "Share button" in SharePoint 2013, simply disable access requests.
How to Disable Sync buttons in SharePoint 2013
To disable sync, Navigate to Site settings >> Click on "Search and offline availability" >> set offline client availability to "No". There are few more ways discussed in my another article: Hide Sync Button in SharePoint 2013
How to disable "Follow" button in SharePoint 2013?
To disable "Follow" button in SharePoint 2013, You'll have to disable a feature called "Following Content". Navigate to:
Share Button:
Follow Button:
Sync Button:
To hide these controls, simply move them inside Comment block. <!-- -->. Do not delete this controls from the Master page! You'll end-up in crash!!
Tips: This hides Share button from promoted actions section. But share button is present in ECB/Callout menu and in list view quick control also. To hide them all as well, use selectors: a[id$="site_share_button"], a.ms-calloutLink[title="Share"], button.js-listview-qcbShareButton.
You might also like:
*Sponsored

How to disable "Share" button in SharePoint 2013?
Share button is relying on "Access requests" configuration of the site. To disable "Share button" in SharePoint 2013, simply disable access requests.
- Go to Site settings page of your SharePoint site.
- Click on "Site Permissions" link under "Users and Permissions" group
- Click on "Access Request Settings" in the ribbon.
- Uncheck "Allow access request" and click on "Ok" to save your changes. This should hide Share button in SharePoint 2013.

How to Disable Sync buttons in SharePoint 2013
To disable sync, Navigate to Site settings >> Click on "Search and offline availability" >> set offline client availability to "No". There are few more ways discussed in my another article: Hide Sync Button in SharePoint 2013
How to disable "Follow" button in SharePoint 2013?
To disable "Follow" button in SharePoint 2013, You'll have to disable a feature called "Following Content". Navigate to:
- Site Settings >> Click on "Manage Site Features"
- Click on "Deactivate" on " Following Content" feature
Disable Access Request, Deactivate Features using PowerShell:
- Share: To disable access requests on all sites using PowerShell, refer: Disable access request in SharePoint 2013
- Following: To deactivate "Following content" feature using PowerShell as:1
- Sync: To exclude from offline client, run:1
Get-SPSite-limitall | get-SPWeb-limitall |Foreach{ $_.ExcludeFromOfflineClient=1; $_.Update()}
Remove Share, Follow, Sync buttons at Master page level:
These promoted action buttons are in master page as follows:Share Button:
1
| <SharePoint:SPSharePromotedActionButton ID="SPSharePromotedActionButton1" runat="server" /> |
1
| <SharePoint:DelegateControl ID="DelegateControl2" runat="server" ControlId="PromotedActions" AllowMultipleControls="true" /> |
1
| <SharePoint:SPSyncPromotedActionButton ID="SPSyncPromotedActionButton1" runat="server" /> |
CSS to hide Share, Follow and Sync Buttons:
Lets hide them based on their IDs. You can place this CSS code with "Script Editor" web part or you can place it in Master page.- Sync button's id: ctl00_SyncPromotedAction
- Follow button id: site_follow_button
- Share button's id: ctl00_site_share_button
1
2
3
4
5
6
7
8
| <style type="text/css">a[id$=site_share_button], a[id$=SyncPromotedAction], a#site_follow_button{ display: none !important;} </style> |
You might also like:
| SharePoint Usage Reports Usage reports, collaboration and audit for SharePoint. | Five Challenges in SharePoint Security ...And How to Solve Them. Free White Paper |
Sunday, February 1, 2015
Application Pool Monitoring for SharePoint using PowerShell Script
If SharePoint Application Pools are stopped that would cause "Service Unavailable" outages to your SharePoint environment! While SCOM can monitor SharePoint IIS web application's application pool status, it makes bit more noisy with alerts and doesn't start the application pool automatically - when stopped. So, lets address this issue with the help of PowerShell! Here is my nifty PowerShell script to monitor application pools on all SharePoint web front end servers.
This script not only scans IIS Application Pool status on SharePoint Web-Front end servers, But also:
Here is the sample alert from IIS AppPool monitoring script:
Schedule this PowerShell script in Windows Task scheduler in any Application server (or any other server will do!) to periodically scan App Pool status, Say once per 5 Min! run interval can be adjusted based on your application priority.
Here is my another post on Scheduling PowerShell scripts using Windows Task scheduler: Create a Scheduled Task for PowerShell Script with Windows Task Scheduler
You might also like:
*Sponsored
This script not only scans IIS Application Pool status on SharePoint Web-Front end servers, But also:
- Logs application Pool status if its not in Started state
- Automatically starts AppPool if its in stopped state
- Sends out an Alert-Email to SharePoint Admin team (or whoever configured!)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
| Import-Module WebAdministration#Array to hold Server names - Change it to YOUR SharePoint front end servers$WFEServers =("HS-WFE01", "HS-WFE02", "HS-WFE03")#Log file location$LogFile = "D:\Scripts\AppPool-Log.txt"#Loop through each server and Check Application Pool statusforeach ($Server in $WFEServers){ $ServerMgr = [Microsoft.Web.Administration.ServerManager]::OpenRemote($Server) #Get all Application Pools which are not in Started State $AppPoolColl = $ServerMgr.ApplicationPools | Where-Object {$_.State -ne "Started"} foreach($AppPool in $AppPoolColl) { #Get the time to Log $now = Get-Date –f "yyyy-MM-dd HH:mm:ss" #Log to file "`n Found Application Pool: $($AppPool.name) in stopped state at the server : $($Server) on $($now)" >> $LogFile "Trying to Start the application Pool...">> $LogFile #Try Starting the application Pool $AppPool.Start() Start-Sleep -s 10 "Application Pool's current Status: $($AppPool.State)" >> $LogFile #Send Alert-Mail message $emailFrom = "AppPoolMonitor@crescent.com" # Use commas for multiple addresses $emailTo = "SPAdmins@crescent.com" $subject = "Application Pool: $($AppPool.Name) in stopped state in Server: $($Server) at $($now)" $body = "Hi SharePoint Team, `n `n The Application Pool $($AppPool.name) was in stopped state in server: $($server). `n`n We tried Re-starting it... Current State of the Application Pool: $($AppPool.State). `n`n Please take necessary actions if its not started !. `n `nThanks, `nSharePoint AppPool Monitoring Script." $smtpServer = "smtp.crescent.com" #IP or HOST Name of SMTP Server $smtp = new-object Net.Mail.SmtpClient($smtpServer) $smtp.Send($emailFrom, $emailTo, $subject, $body) } } |
Schedule this PowerShell script in Windows Task scheduler in any Application server (or any other server will do!) to periodically scan App Pool status, Say once per 5 Min! run interval can be adjusted based on your application priority.
Here is my another post on Scheduling PowerShell scripts using Windows Task scheduler: Create a Scheduled Task for PowerShell Script with Windows Task Scheduler
You might also like:
| SharePoint Usage Reports Usage reports, collaboration and audit for SharePoint. | Five Challenges in SharePoint Security ...And How to Solve Them. Free White Paper |
Sunday, January 25, 2015
Delete Button Missing in SharePoint Column? Here is How to Delete them.
How to delete a Column when Delete Button is missing:
Unable to delete list column in SharePoint since there is no delete button in field properties? In some cases, columns added through "Add existing columns" doesn't provide the option to delete! To make them deletable, just revert these two properties: AllowDeletion & Sealed

Here is how to delete SharePoint list column programmatically with PowerShell:

We can also make fields to Sealed, So that nobody can change the field settings.
SharePoint Manager tool can be used to set these properties. Just navigate to the site, list or library and set the "AllowDeletion" property to false, save the changes. This hides delete option in SharePoint list.
Unable to delete list column in SharePoint since there is no delete button in field properties? In some cases, columns added through "Add existing columns" doesn't provide the option to delete! To make them deletable, just revert these two properties: AllowDeletion & Sealed

Here is how to delete SharePoint list column programmatically with PowerShell:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
| #Get the Web#Get the List$list = $web.Lists["Design Documents"]#Get the column$column = $list.Fields["Category"]#Disable Delete$column.AllowDeletion = $true$column.Sealed = $false$column.Update()#To delete a SharePoint list column in PowerShell, use: $column.Delete() $web.Dispose() |

We can also make fields to Sealed, So that nobody can change the field settings.
SharePoint Manager tool can be used to set these properties. Just navigate to the site, list or library and set the "AllowDeletion" property to false, save the changes. This hides delete option in SharePoint list.

Read more: http://www.sharepointdiary.com/#ixzz3UckFOs3M




No comments:
Post a Comment