Hello,
Our SaaS Sharepoint storage reached its maximum limit and I would like to know if there is a sensor or custom sensor setting that I can use to monitor this. Same as how we monitor disk space on a computer and get alerts when it goes below certain limit.
Thank you in advance.
Regards, B
Article Comments
Hi @Johannes, thank you for your quick response. We have hosted Sharepoint 365 at Microsoft's Azure Cloud. I have created a custom sensor with PowerShell and it works outside PRTG but the sensor doesn't bring up any values since it displays "No valid OAuth 2.0 authentication session exists". I want it to alert when the storage quota (available space) exceeds a specific limit. Thanks!
#Parameters $AdminCenterURL = "https://companyname-admin.sharepoint.com" $CSVPath = "C:\Temp\SiteUsageRpt.csv" { #Connect to Admin Center Connect-SPOService -Url $AdminCenterURL #Get all site usage details $Storage = Get-SPOGeoStorageQuota -AllLocations | Select * $SiteUsageData = @() ForEach ($Site in $Storage) { #Collect site data $SiteUsageData += New-Object PSObject -Property ([ordered]@{ 'Geo Location' = $Site.GeoLocation 'Geo Used Storage MB' = $Site.GeoUsedStorageMB 'Geo Available Storage MB' = $Site.GeoAvailableStorageMB 'Geo Allocated Storage MB' = $Site.GeoAllocatedStorageMB 'Tenant Storage MB' = $Site.TenantStorageMB 'Quota Type' = $Site.QuotaType }) } $SiteUsageData #Export Site Usage Data to CSV $SiteUsageData | Export-Csv $CSVPath -NoTypeInformation Write-Output "Site Usage Report Generated Successfully!" -ForegroundColor Green } Catch { Write-Output -ForegroundColor Red "Error generating site usage report:" $_.Exception.Message }
Regards, B
Aug, 2022 - Permalink
Hello B,
if you run it directly in PowerShell it will use your current Azure AD credentials to authenticate against your SharePoint instance.
If you want to run it in PRTG you will need an Auth token as described for example here: https://docs.microsoft.com/en-us/azure/storage/blobs/authorize-data-operations-powershell
Kind regards,
Johannes Beyerlein, Technical Support Team
Aug, 2022 - Permalink
Hello B,
Are you referring to a On-Premises Sharepoint installation, a hosted Sharepoint installation by a third party or hosted Sharepoint 365 at Microsoft's Azure Cloud?
Depending on this there can be different possibilities.
Kind regards,
Johannes Beyerlein, Technical Support Team
Aug, 2022 - Permalink