Question

Hoping someone can help out with this issue on SP19 on premise.

If I run the following on certain site collections, I get an empty value returned

Get-SPSite "" | Select ReadOnly,Readlocked,WriteLocked

enter image description here

On other site collections I get an expected return

enter image description here

I have ran the following and can see the changes being made via Central Admin

  1. Set-SPSite -identity "Site name" –lockstate "ReadOnly"
  2. Set-SPSite -identity "Site name" –lockstate "Unlock"

But upon checking the state via Powershell I still see empty values. I have checked the database and this was in a 'Normal' state.

So everything looks to be working correctly other than the empty values being returned, yet when running any PS that checks the lock status I get "The current site collection is locked" message.

Is there any way this can be corrected?

Thanks for any assistance in advance.

Was it helpful?

Solution

Looks like a permission issue, Could you please make sure that Account running the powershell command should have correct permission.

  • Site collection Admin / Policy of Web app level
  • If farm admin account then DBO on the content database.
Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top