I came across an interesting issue recently, where our production sites flag notification for every user was “We apologize for any inconvenience”.
This issue, for regarding a scheduled backup task scheduler, failed orwas interrupted for any resign.
In my case, at the time of scheduler, the drive did not have sufficient space. The backup process was abnormally terminated.
This resulted in all Sites being in Read only mode & the following message would show up, when users browsed to the site.
“We apologize for any inconvenience, but we've made the site read only, while we're making improvements."
Go to "Site collection Quota & locks" in Central Admin. Here is what the Status looks like. It is locked as “Read only" and all settings are greyed out, even though you have administrator permission.
Here, is more on this behaviour and how to get out of this situation.
In SharePoint 2013, microsoft introduced a property MaintenanceMode, for Spsite object, which indicates the site is undergoing Maintenance and is read only. SPSite.MaintenanceMode flag, can be set on a site for several reasons, like content database is in read only state, site collection is being upgraded, and backed up or moved.
If a site gets into a state where the action that set this has terminated in a way where this is still set, we run into this situation.
Solutions
The way to clear this flag notification is to use the ClearMaintenanceMode method, in SpSiteAdministration object. Here, is how it can be done, via SharePoint Management Shell.
Option Command 1
#Run this command search site separately or run one by one all top level sites, if we have multiple top level sites/ Web application.
Step 1
- $Admin = new-object
- # SiteName “http://myweb.adnec.local/”.
- Microsoft.SharePoint.Administration.SPSiteAdministration(‘SiteName’)
Step 2
- $Admin.ClearMaintenanceMode()
Step 3
Option Command 2
- Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
- #Clears all the maintenance modes for all Site Collections in the farm.
- $webapp = Get-SPSite -Limit ALL
- foreach ($site in $webApp){
- $Admin = new-object Microsoft.SharePoint.Administration.SPSiteAdministration($site.url)
- $Admin.ClearMaintenanceMode()
- }