Hi @sns ,
You could refer this Powershell command template to export site collection URLs from CSV file:)
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
$CSVFile="C:\test\SitesStatusList.csv"
Import-csv "C:\test\SitesList.csv" | ForEach-Object {
$Site = Get-SPSite $_.Url
if ($Site.ReadOnly -eq $false -and $Site.ReadLocked -eq $false -and $Site.WriteLocked -eq $false)
{
$Results = "Unlocked"
}
elseif ($Site.ReadOnly -eq $true -and $Site.ReadLocked -eq $false -and $Site.WriteLocked -eq $true)
{
$Results = "Read-Only"
}
#Adding Content Prevented?
elseif ($Site.WriteLocked -eq $true -and $Site.ReadLocked -eq $false -and $Site.ReadOnly -eq $false)
{
$Results = "Adding Content Prevented"
}
elseif ($Site.ReadOnly -eq $null -and $Site.ReadLocked -eq $null -and $Site.WriteLocked -eq $null)
{
$Results = "No Access"
}
New-Object -TypeName PSObject -Property @{
SiteName = $Site.RootWeb.Title
Url = $Site.Url
SiteStatus = $Results}
}| Export-CSV $CSVFile -NoTypeInformation
Use this command you could export the results to a new CSV file. If you only want to display the results, the command of exporting to a new CSV file could be removed.
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.