Tried running commands as Farm Admin:

When I run :

$site.GetType().GetProperty("MaintenanceMode").GetSetMethod($true).Invoke($site, @($false))

I get an error:

Exception calling "Invoke" with "2" argument(s): "Failed to update database "Content_Collab" because the database is read-only."

Any ideas why this won't run without errors?

  • are you have RTM verson ? what's the latest CU installed in your farm ? Nov 22, 2016 at 17:54
  • did you check if database is really read-only in SharePoint or SQL server?
    – Waqas Sarwar MVP
    Nov 22, 2016 at 17:54

1 Answer 1


Sometimes, when a maintenance not completed successfully then it put the Sites/DB in read only mode. to clear this mode please runt he below command.

$Admin = new-object Microsoft.SharePoint.Administration.SPSiteAdministration(‘http://weburl/sites/sitecollectionurl’)


Read more here

If that is not the case then check couple of thing son the

  • SQL server has enough space on data drive
  • Database is not marked as read only at SQL
  • From central admin, it is not marked read only

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.