Powershell script to report user OneDrive site collection

LouD 6 Reputation points
2024-03-14T14:18:29.3633333+00:00

Good afternoon,  I’m looking for help with scripting a report to show all users OneDrive Notebooks storage usage.

 

I’m aware of the usage reports in admin, but I would like to drill down further to the users site collection for notebooks.

 

The reason for this is that the business wish to add a retention policy to OneDrive, and we need to assess the impact for users NoteBooks.

 

I’ve got a script for OneDrive total and have tried adjusting the Url with no luck. I’m not familiar with powershell scripts. Is there anyone able to help me please?

 

Get-SPOSite -IncludePersonalSite $true -Limit all -Filter "Url -like '-my.sharepoint.com/personal/'" | Select URL, Owner, StorageQuota, StorageUsageCurrent, LastContentModifiedDate | Export-CSV 'C\Documents\test1.csv'

 I had hoped something like this would work;

my.sharepoint.com/personal/*/Documents/Notebooks/

thanks for reading

SQL Server Reporting Services
SQL Server Reporting Services
A SQL Server technology that supports the creation, management, and delivery of both traditional, paper-oriented reports and interactive, web-based reports.
2,796 questions
Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
3,473 questions
PowerShell
PowerShell
A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
2,039 questions
{count} votes