Share via


SharePoint Online: How to get a listing of all OneDrives in your Tenant using PowerShell

It takes just a little bit of PowerShell to quickly obtain a listing of all the OneDrives your users have in your tenant.  You can use this listing to verify sharing settings, check up on individual storage usages, get a total OneDrive storage usage, get a count of total active OneDrive usage, etc.  Once you download the data into a spreadsheet, you can perform all sorts of analyses. 

Script

 Here's the script:

Connect-SPOService

    -Url "https://[tenantname]-admin.sharepoint.com"

    -Credential "MyTenantAdminAcct"

$OutFile = [Environment]::GetFolderPath("Desktop") + "\AllOneDriveSites.csv"

 

Get-SPOSite -IncludePersonalSite $true -Limit all -Filter "Url -like '-my.sharepoint.com/personal/'" | `

Export-CSV -Path $OutFile -Force

References

Notes

  • tbd