1

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.

2
  • maybe try to close the PowerShell console and re open it. make sure account has permission on the DB ( account running powershell).
    – Waqas Sarwar MVP
    Commented Feb 19, 2021 at 14:23
  • 1
    @WaqasSarwarMVP, much appreciated. I ran the same commands as Farm Admin and got a return. I added Sharepoint account to Collection Administrators and it now returns the values I was looking for. Cannot thank you enough. Now how do I mark your reply as helpful or as the answer?
    – KevP
    Commented Feb 19, 2021 at 14:46

1 Answer 1

0

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.

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.