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.
Why use this workflow
SharePoint sites and OneDrive accounts in Microsoft 365 have per-site and per-user storage quotas. When a site reaches its quota, uploads fail, sync breaks, and workflows stall. Reviewing quotas regularly lets you spot hot spots early, plan cleanup of stale content or version history, and expand quotas before users are affected.
Run this workflow on a regular cadence as part of tenant governance, or on demand when storage-related tickets increase, 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 is high
Expected outcomes
After completing this workflow 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 (for example, 80% of quota)
- A ranked list of top storage consumers for cleanup or quota-increase decisions
- An audit-ready CSV or report suitable for sharing with data owners or compliance
- A recommendation for each at-risk site: cleanup, archive, or expand quota
Risks and considerations
Things to watch for
- Report latency: Graph usage reports lag real-time activity. 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 are masked. Turn it off temporarily (requiresReportSettings.ReadWrite.All) or correlate by Site ID. - Do not auto-delete: Do not script automatic file deletion based on storage reports. Involve the site owner and follow retention and 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: Many full sites are inflated by major version history, not active content. Check version settings before provisioning more storage.
- Deleted sites: Sites flagged
Is Deleted = Truecan still appear in the report. 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 and UPNs are visible. |
| SharePoint Administrator | Required in the SharePoint admin center to view quotas and to adjust site-level quotas if expansion is chosen. |
Ask Dex
Paste the prompt into a Dex conversation.
Prompt for IT admins
Review SharePoint sites and OneDrive accounts nearing their storage quotas. Pull the getSharePointSiteUsageDetail and getOneDriveUsageAccountDetail reports (period D90), flag any resource at or above {threshold_percent}% of its allocated quota, rank the top consumers, and produce a CSV of at-risk sites with owner and recommended action (cleanup vs. expand).
Manual steps (admin center)
- Sign in to the Microsoft 365 admin center as a Global Administrator or SharePoint Administrator.
- In the left navigation, expand Admin centers and select SharePoint.
- In the SharePoint admin center, go to Sites > Active sites.
- Use the column options to display Storage used (GB) and Storage limit (GB).
- Click the Storage used (GB) column header to sort descending. The sites closest to their quota 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 it if it is obsolete.
- For OneDrive, go to the Microsoft 365 admin center and open Reports > Usage > OneDrive > Usage. Use the storage view to identify accounts nearing their per-user quota.
- Click Export to save the report as a CSV for record-keeping and to share with data owners.
Tip! If owner names appear as anonymized, go to Settings > Org settings > Services > Reports in the Microsoft 365 admin center and clear Display concealed user, group, and site names in all reports.
Microsoft Graph API
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, and 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, and D180.
3. (Optional) Turn off name concealment
If the report returns anonymized owners, patch the 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
...
PowerShell
The approach uses Microsoft.Graph.Reports to download both CSV reports, parse them, compute percent used, and produce an alerts table plus a ranked top-N list. It then exports the results to CSV for sharing.
Prerequisites
- PowerShell 7 or later recommended
Install-Module Microsoft.Graph -Scope CurrentUser- Delegated or application permission:
Reports.Read.All
Approach
Connect-MgGraphwithReports.Read.All.Get-MgReportSharePointSiteUsageDetailandGet-MgReportOneDriveUsageAccountDetailwith-Period D90write CSV data to a temporary file.Import-Csvparses each report.- Calculated properties produce
UsedGB,AllocatedGB, andPercentUsed. - Filter at your chosen threshold percentage (for example, 80) and export the results to three CSV files: SharePoint, OneDrive, and alerts.