Small Tips and Tricks – PowerShell – Reading all onedrive urls, owners and storage quota

PowerShell - Fetching all onedrive URLs, owners and Storage Quota
PowerShell - Fetching all onedrive URLs, owners and Storage Quota

Hi All,

Greetings for the day!!! LIFE IS BEAUTIFUL 🙂

Today I got a request from my manager to have list of all onedrive urls and there storage quota details.

So the PowerShell in picture. Its very small PowerShell but seems to be very handy so sharing 🙂

Details :

  • Connect to SharePoint Online Administration Center using Connect-SPOService

Connect-SPOService -Url $AdminSiteURL -credential (Get-Credential)

  • On execution of this CMDLET prompt will appear for credentials

fig : Credential prompt for Connect-SPOService CMDLET
fig : PowerShell – Credential prompt for Connect-SPOService CMDLET
  • Once we have entered credential successfully, we will execute fetch all onedrive URLs and storage details
  • We will use Get-SPOSite CMDLET and filter on “-my.sharepoint.com/personal/

Get-SPOSite -IncludePersonalSite $true -Limit all -Filter "Url -like '-my.sharepoint.com/personal/'" | Select URL, Owner, StorageQuota, StorageUsageCurrent | Export-Csv -Path "C:/OneDrive details/onedrivedetails.csv" -NoTypeInformation

fig : PowerShell - Fetching all onedrive URLs, owners and Storage Quota
fig : PowerShell – Fetching all onedrive URLs, owners and Storage Quota

Thanks for reading !!! Please feel free to discuss / suggestions / share thoughts !!!

HAVE A GREAT TIME AHEAD !!! LIFE IS BEAUTIFUL 🙂

Prasham Sabadra

LIFE IS VERY BEAUTIFUL :) ENJOY THE WHOLE JOURNEY :) Founder of Knowledge Junction and live-beautiful-life.com, Author, Learner, Passionate Techie, avid reader. Certified Professional Workshop Facilitator / Public Speaker. Scrum Foundation Professional certificated. Motivational, Behavioral , Technical speaker. Speaks in various events including SharePoint Saturdays, Boot camps, Collages / Schools, local chapter. Can reach me for Microsoft 365, Azure, DevOps, SharePoint, Teams, Power Platform, JavaScript.

You may also like...

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: