Fetchig the all unlocked sites from SHarePoint server

sns 9,226 Reputation points
2022-11-10T15:31:00.8+00:00

Please share me the script to get the list of all site collections which are not in read mode and locked mode ( meaning all unlocked sites) and exporting to CSV from particular web applicaiton, it is sharepoinnt 2013

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,798 questions
{count} votes

Accepted answer
  1. Renjie Sun-MSFT 2,846 Reputation points Microsoft Employee
    2022-11-11T08:26:25.307+00:00

    Hi @sns ,

    You could refer this PowerShell command template:

    Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue  
       
    $WebAppURL="http://sp13"  
    $CSVFile="C:\SitesList.csv"  
      
    Get-SPWebApplication $WebAppURL | Get-SPSite -Limit All | ForEach-Object {  
    if ($_.ReadOnly -eq $false -and $_.ReadLocked -eq $false -and $_.WriteLocked -eq $false){  
        New-Object -TypeName PSObject -Property @{  
                 SiteName = $_.RootWeb.Title  
                 Url = $_.Url}}  
    } | Export-CSV $CSVFile -NoTypeInformation  
    

    Should you have any questions or concerns, please do feel free to contact me.

    Yours faithfully,
    Renjie Sun


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    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.


0 additional answers

Sort by: Most helpful