Script to make unlock the sites from particualr db

sns 7,281 Reputation points

Particular db has sites, in this db site status are read only in sharepoint
I want to unlock all sites from that db. Please help me with script. Thank you.

SharePoint Server Management
SharePoint Server Management
SharePoint Server: A family of Microsoft on-premises document management and storage systems.Management: The act or process of organizing, handling, directing or controlling something.
2,364 questions
No comments
{count} votes

Accepted answer
  1. Jerry Xu-MSFT 7,781 Reputation points

    Hi, @sns ,

    You can use the following script to unlock sites from certain database.

    $db=Get-SPContentDatabase | where-object {$_.Name -eq '<Content Database Name>'}  
    $sites=Get-SPSite -ContentDatabase $  
    foreach($site in $sites)  
    		Set-SPSite -Identity $site.URL -LockState Unlock  

    If an Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    No comments

0 additional answers

Sort by: Most helpful