Site collection lock status returns empty value
-
21-02-2021 - |
Domanda
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
On other site collections I get an expected return
I have ran the following and can see the changes being made via Central Admin
- Set-SPSite -identity "Site name" –lockstate "ReadOnly"
- 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.
Soluzione
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.