@sns
1.Go to Central Administration -> Application Management -> Configure quotas and locks -> Select the site collection -> Set the value of "Send warning e-mail when site storage reaches".
2.Create an input csv file with site collection URLs.
3.Run below PowerShell.
if ((Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue) -eq $null)
{
Add-PSSnapin "Microsoft.SharePoint.PowerShell"
}
$results = @()
$csv = Import-Csv "the local path of csv file, such as C:\sites.csv"
$a = $csv.Url
try
{
foreach ($_ in $a)
{
$Site = Get-SPSite $_
$RowDetails = @{
"Site URL" = $site.Url
"Storage Used" = $site.Usage.Storage/1MB
"Storage Available Warning" = $site.Quota.StorageWarningLevel/1MB
"Storage Available Maximum" = $site.Quota.StorageMaximumLevel/1MB
}
$results += New-Object PSObject -Property $RowDetails
$site.Dispose()
}
}
catch
{
$e = $_.Exception
$line = $_.InvocationInfo.ScriptLineNumber
$msg = $e.Message
Write-Host -ForegroundColor Red "caught exception: $e at $line"
Write-Host $msg
write-host "Something went wrong"
}
$results | Export-csv -Path "C:\SiteQuotaDetailedInfo.csv" -NoTypeInformation
Write-Host "-------------------- Completed! -----------------------------"
4.Compare "Storage Used" with "Storage Available Warning" in the output csv file.
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.