๐ Recipe ยท SharePoint & OneDrive
Review SharePoint and OneDrive Storage Quotas to Identify Sites Nearing Limits
Identify SharePoint sites and OneDrive accounts approaching storage quotas using Microsoft Graph usage reports, and plan cleanup or quota expansion.
Complexity
Intermediate
Impact
governance + cost-optimization + capacity-planning + sharepoint + onedrive
Context
Why This Matters
SharePoint sites and OneDrive accounts in Microsoft 365 have per-site and per-user storage quotas. When a site hits its quota, uploads fail, sync breaks, and workflows stall โ often with no warning until users complain. Proactive quota review lets administrators spot hot spots early, plan cleanup of stale content or version history, and expand quotas before they bite.
Run this recipe on a regular cadence (monthly or quarterly) as part of tenant governance hygiene, or on demand when storage-related tickets spike, before a large migration, or when the tenant's pooled SharePoint storage is nearing its overall limit.
When to run it
- Monthly or quarterly governance review
- Users report failed uploads or sync errors
- Before onboarding a large team, project, or migration
- When tenant-level SharePoint storage utilization crosses 75%
Expected Outcomes
After completing this recipe you will have:
- A full inventory of SharePoint sites and OneDrive accounts with current
Storage UsedandStorage Allocatedvalues - A filtered list of resources exceeding the alert threshold (default 80% of quota)
- A ranked list of top storage consumers for cleanup or quota-increase decisions
- An audit-ready CSV/report suitable for sharing with data owners or compliance
- A defensible recommendation for each at-risk site: cleanup, archive, or expand quota
Risks & Considerations
Warnings & gotchas
- Report latency: Graph usage reports lag real-time activity by 24โ48 hours. A site that just filled up may not appear in the report yet.
- Anonymized names: If
displayConcealedNamesis enabled in the tenant's report settings, owner display names and UPNs will be masked. ToggleReportSettings.ReadWrite.Alltemporarily or correlate by Site ID. - Do not auto-delete: Never script automatic file deletion based on storage reports. Always involve the site owner and follow retention/legal-hold policies before removing content.
- Quota vs. tenant pool: Increasing a single site's quota does not create new storage โ it draws from the tenant's pooled allotment. Confirm tenant-level headroom in the SharePoint admin center first.
- Version history sprawl: Most "full" sites are bloated by major version history, not active content. Check version settings before provisioning more storage.
- Archived / deleted sites: Sites flagged
Is Deleted = Truestill appear in the report for 93 days. Exclude them from alerting.
Required Permissions
| Permission | Why It's Needed |
|---|---|
| Reports.Read.All | Read SharePoint and OneDrive usage detail reports via Microsoft Graph. |
| Sites.Read.All | Resolve site URLs and metadata when reports do not include them. |
| ReportSettings.ReadWrite.All | Optional โ toggle tenant report anonymization so owner names/UPNs are visible. |
| SharePoint Administrator | Required in the SharePoint admin center to view quotas in the GUI and to adjust site-level quotas if expansion is chosen. |
The fastest way to get this done: just ask Dex. Copy the prompt below and paste it into your Dex conversation.
For IT Admins
Paste into Dex Pro
Review storage quotas via the SharePoint admin center
Sign in to the Microsoft 365 admin center at
https://admin.microsoft.comas a Global Admin or SharePoint Administrator.In the left navigation, expand Admin centers and select SharePoint.
Admin centers โ SharePoint
In the SharePoint admin center, go to Sites โ Active sites.
Sites โ Active sites
Click the gear / column options icon and ensure the columns Storage used (GB) and Storage limit (GB) are displayed.
Click the Storage used (GB) column header to sort descending. The sites closest to their quota will appear at the top.
For each site near its limit, click the site name to open its properties panel. Review Storage, then decide:
- Expand: Increase the storage limit (if pooled tenant storage allows).
- Cleanup: Contact the site owner to remove stale files, reduce version history, or empty the recycle bin.
- Archive: Move the site to Microsoft 365 Archive or delete if obsolete.
For OneDrive, switch to the Microsoft 365 admin center โ Reports โ Usage, then open OneDrive โ Usage. Use the Storage view to identify accounts nearing their per-user quota.
Reports โ Usage โ OneDrive โ Usage
Export the report to CSV (Export button) for record-keeping and to share with data owners.
Tip
If owner names show as anonymous, go to Microsoft 365 admin center โ Settings โ Org settings โ Services โ Reports and uncheck Display concealed user, group, and site names in all reports.
Pull usage reports with Microsoft Graph
Two Graph endpoints return CSV reports with the Storage Used (Byte) and Storage Allocated (Byte) columns needed to compute percent-used per site and per OneDrive.
1. SharePoint site usage
GET https://graph.microsoft.com/v1.0/reports/getSharePointSiteUsageDetail(period='D90')
Authorization: Bearer <access_token>
Accept: text/csvReturns a CSV with columns including Site Id, Site URL, Owner Display Name, Owner Principal Name, Storage Used (Byte), Storage Allocated (Byte), Is Deleted, Last Activity Date.
2. OneDrive account usage
GET https://graph.microsoft.com/v1.0/reports/getOneDriveUsageAccountDetail(period='D90')
Authorization: Bearer <access_token>
Accept: text/csvValid period values are D7, D30, D90, D180. Reports are refreshed daily with ~48h latency.
3. (Optional) Turn off name concealment
If the report returns anonymized owners, patch tenant report settings:
PATCH https://graph.microsoft.com/v1.0/admin/reportSettings
Content-Type: application/json
{
"displayConcealedNames": false
}4. Compute alerts client-side
For each CSV row, compute percent = StorageUsed / StorageAllocated * 100 and filter where percent >= 80 (or your preferred threshold) and Is Deleted = False. Sort descending by percent to get the at-risk list.
Response example (SharePoint CSV, abbreviated)
Report Refresh Date,Site Id,Site URL,Owner Display Name,Is Deleted,Storage Used (Byte),Storage Allocated (Byte)
2026-02-14,6bee9a7d-...,https://contoso.sharepoint.com/sites/Mark8,Mark 8 Project Team Owners,False,1454493,27487790694400
...Pull and analyze storage usage with PowerShell
The script below uses Microsoft.Graph.Reports to download both CSV reports, parses them, computes percent-used, and emits an alerts table plus a ranked top-N list. It then exports everything to CSV for sharing.
Prerequisites
- PowerShell 7+ recommended
Install-Module Microsoft.Graph -Scope CurrentUser- Delegated or application permission:
Reports.Read.All
How it works
Connect-MgGraphwithReports.Read.All.Get-MgReportSharePointSiteUsageDetailandGet-MgReportOneDriveUsageAccountDetailwith-Period D90return CSV data to a temp file.Import-Csvparses each report.- Calculated properties produce
UsedGB,AllocatedGB, andPercentUsed. - Results are filtered at the configurable
-ThresholdPercent(default 80) and exported.
Run it
.\Review-M365StorageQuotas.ps1 -ThresholdPercent 80 -Period D90 -OutputFolder C:\Reports\StorageOutputs: SharePoint-Storage-YYYYMMDD.csv, OneDrive-Storage-YYYYMMDD.csv, and Storage-Alerts-YYYYMMDD.csv.
Next steps