Thursday, December 24, 2015

Site collection locked & stucked in read only mode


I do have a SharePoint (2013) site collection that is stuck in read only mode due to a backup that was either interrupted or didn't terminated properly.
I'm unable to unlock from :
  • Site Quotas and Lock in Central Administration (option is greyed-out)
  • Stsadm : operation completes successfully but no change
  • Using PowerShell : same behavior as stsadm


Solution it worked for me :)


An alternate solution to the problem of not having upgraded to April 2013 CU is a simple powershell script that uses reflection to set the value of the internal 'MaintenanceMode' property:-
$site = Get-SPSite http://urltofreakinlockedsite/
$site.GetType().GetProperty("MaintenanceMode").GetSetMethod($true).Invoke($site, @($false))