Articles about European Sharepoint Hosting Service
SharePoint 2013 Hosting – HostForLIFE.eu :: Get Site Quota Information For SharePoint Farm
Site Quota comes in handy when you wish to enforce the size limits in your SharePoint site collections. It lets you set the storage limit values and warning limit values, for better farm management. The below script will bring forth the site quota and other related information, such as maximum storage limit, maximum storage warning, etc. for the entire farm. The output will be in CSV format.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
if ((Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue) -eq $null) { Add-PSSnapin "Microsoft.SharePoint.PowerShell" } $templates = [Microsoft.SharePoint.Administration.SPWebService]::ContentService.quotatemplates $tFound = $false $templateName = "No template found" $results = @() $sites = Get-SPSite -Limit ALL try { foreach ($site in $sites) { foreach ($qt in $templates) { if ($qt.QuotaId -eq $site.Quota.QuotaID) { $templateName = $qt.Name; $tFound = $true } } if ($tFound -eq $false) { $templateName = “No Template Applied” } $tFound=$false; $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 "Sandboxed Resource Points Warning" = $site.Quota.UserCodeWarningLevel "Sandboxed Resource Points Maximum" = $site.Quota.UserCodeMaximumLevel "Quota Name" = $templateName } $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! -----------------------------" |
Print article | This entry was posted by Peter on January 25, 2018 at 5:18 am, and is filed under European SharePoint 2013 Hosting. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |