Find OneDrive accounts near their storage quota with PowerShell

Published: Updated: 4 min readOneDrive, PowerShell
Onedrive Usage

A client asked me which of their OneDrive accounts would start costing money once pay-as-you-go OneDrive storage goes live , they have tenant with about 2,000 users and a handful of engineers storing CAD files. Microsoft announced it in MC1477185 on 22 September 2026, general availability rolls out from early November, and only storage above an account’s licensed quota is billed (at $0.20 per GB per month). So before anyone enables the billing policy, you want a list of who is close to their limit and who is already over it.

Updated 20 November 2026: the script is now a function, Get-MttOneDriveUsage. It no longer signs in or writes the CSV itself, and it adds a column for storage above the licensed amount, which is what pay-as-you-go actually bills.

On this page

Using the Microsoft 365 admin center

For one user, the admin center is quickest.

  1. Open the Microsoft 365 admin center > Users > Active users.
  2. Select the user and open the OneDrive tab.
  3. Check Storage used. The panel shows usage against the current limit.
Using the Microsoft 365 admin center - screenshot

For the whole tenant there is the OneDrive usage report under Reports > Usage. I don’t trust it for this job right now. Microsoft flagged a refresh issue (MO1471241) that may have left usage reports stale since 8 September 2026, and the report doesn’t give you a percentage of quota anyway.

Onedrive Usage

Using PowerShell

The function below reads every OneDrive account directly, works out how much of its quota is used and how much is above the storage the licence includes, and returns one row per account. It uses the SharePoint Online Management Shell and needs the SharePoint Administrator role.

I use the SPO shell here over PnP.PowerShell because it needs no Entra app registration, and Microsoft’s own quota docs use it.

# Module: SharePoint Online Management Shell (Microsoft.Online.SharePoint.PowerShell)
$AdminURL = "https://mstalk-admin.sharepoint.com"   # Replace with your own

# PowerShell 7 only: Import-Module Microsoft.Online.SharePoint.PowerShell -UseWindowsPowerShell
Connect-SPOService -Url $AdminURL
. .\Get-MttOneDriveUsage.ps1

Get-MttOneDriveUsage -MinPercentUsed 80 |
    Export-Csv -Path "C:\Temp\OneDriveQuotaReport.csv" -NoTypeInformation -Encoding UTF8

Run it in Windows PowerShell 5.1, or in PowerShell 7 after importing the module with -UseWindowsPowerShell. It returns one row per account at or above 80 percent, highest first. The full function is on my GitHub.

Get-MttOneDriveUsage output showing OneDrive storage used, quota, percent used and storage above the licensed entitlement

Both StorageUsageCurrent and StorageQuota come back in MB, and the function converts them to GB. When I first ran the report on a tenant with about 1,200 OneDrive accounts it took under a minute and found two accounts above 80 percent. The screenshot above is the function on my demo tenant, where the accounts are nearly empty, but it shows the new columns.

Note: StorageQuota is the limit set on the account, not the licensed entitlement. If someone has already raised a user to 3 TB, that user can be at 40 percent of quota and still be billed for everything above 1 TB. The function shows this in two columns: EntitlementGB (what you pass with -EntitlementGB, 1024 GB when you leave it out) and OverEntitlementGB, the storage above it. Set -EntitlementGB to what your plan includes, then filter on the second column:

Get-MttOneDriveUsage -EntitlementGB 1024 | Where-Object OverEntitlementGB -gt 0

Raising the limit for selected accounts

Once you know who needs more room, the setup has two parts.

  1. Create a pay-as-you-go billing policy in Microsoft 365 admin center > Billing, and select Microsoft 365 OneDrive Storage as the service. You need an Azure subscription and resource group with Owner or Contributor rights.
  2. Raise the limit for each account that needs it, either on the user’s OneDrive tab > Storage used > Edit > Maximum storage for this user, or with Set-SPOSite.

The PowerShell version, same module, quota in MB (3 TB = 3,145,728 MB):

# Module: SharePoint Online Management Shell
Set-SPOSite -Identity "https://nrqk-my.sharepoint.com/personal/adele_nrqk_com" `
    -StorageQuota 3145728 -StorageQuotaWarningLevel 2936012

The maximum is 25,600 GB per account. Run the report again afterwards and the new quota shows in StorageQuotaGB.

Note: if you later disconnect the billing policy, quota enforcement comes back for every account still above its licensed limit. Keep the CSV so you know who to warn first.

Try it yourself

  1. Install the SharePoint Online Management Shell (Install-Module Microsoft.Online.SharePoint.PowerShell) and sign in with a SharePoint Administrator account.
  2. Download Get-MttOneDriveUsage.ps1 from GitHub.
  3. Run it once with no parameters to see every account, then with -MinPercentUsed 80.
  4. Set -EntitlementGB to what your licence includes and check OverEntitlementGB before you connect the billing policy.

Output columns: UserPrincipalName, SiteUrl, StorageUsedGB, StorageQuotaGB, PercentUsed, EntitlementGB, OverEntitlementGB, LastContentModified, DaysSinceLastChange and LockState.

Share:
Adnan Amin

Adnan Amin

Adnan Amin is a Microsoft MVP for Microsoft 365 (since 2015) and a Senior Microsoft Consultant. He writes practical guides and PowerShell scripts for SharePoint, OneDrive, Teams and Copilot admins.

More posts by Adnan Amin

Leave a Reply

Your email address will not be published. Required fields are marked *