Report · 2 tools

OneDrive storage usage per user

Summary

Builds a OneDrive storage report for capacity planning and migration sizing: owner, storage used, file count and last activity. Two approaches: the SharePoint admin view of personal sites, and the Microsoft Graph usage report.

Implementation

Choose your tool. Your choice is remembered on other samples.

SPO Management Shell
Connect-SPOService -Url "https://<tenant>-admin.sharepoint.com"
Get-SPOSite -IncludePersonalSite $true -Limit All -Filter "Url -like '-my.sharepoint.com/personal/'" |
  Select-Object Owner, Url, @{ n = "StorageGB"; e = { [math]::Round($_.StorageUsageCurrent / 1024, 2) } }, LastContentModifiedDate |
  Sort-Object StorageGB -Descending |
  Export-Csv .\onedrive-storage.csv -NoTypeInformation

Prerequisites

  • SharePoint Administrator, or Reports Reader for the Graph report
  • Graph scope Reports.Read.All

Output

CSV sorted by storage used, largest first.

Contributors

AuthorRole
Priyanshu UpadhyaySolution Architect, Microsoft 365 and Azure
Disclaimer. These samples are provided as is, without warranty of any kind. Read and test every script in a non-production tenant before you run it, and run reports before any command that changes or deletes data.