SOLVED

SharePoint Online - Report (export) all sites, folders, files with folder and file size and type

Silver Contributor

Hello,

is it possible to make a report or to export all sites, folders, files from a SharePoint Online with all names, sizes and file types in a CSV file?

Could this be done with directly from SharePoint Online, PowerShell or Microsoft Graph + PowerShell?

I appreciate your answer.

Kindest regards

Leon

1 Reply
best response confirmed by LeonPavesic (Silver Contributor)
Solution
So there's two ways, Graph API or PowerShell that goes through it all for example:
https://www.sharepointdiary.com/2018/03/sharepoint-online-get-all-documents-using-powershell.html

The code is quite old and won't work but you can get a hum of how to approach this to.

As for Graph API you need to get all Sites, then all libraries in that site, here's some to the API:s you can make use of:
https://learn.microsoft.com/en-us/graph/api/site-list?view=graph-rest-1.0&tabs=http
https://learn.microsoft.com/en-us/graph/api/drive-get?view=graph-rest-1.0&tabs=http
https://learn.microsoft.com/en-us/graph/api/driveitem-list-children?view=graph-rest-1.0&tabs=http


I recommend going the Graph way and doing this in runbook or similar
1 best response

Accepted Solutions
best response confirmed by LeonPavesic (Silver Contributor)
Solution
So there's two ways, Graph API or PowerShell that goes through it all for example:
https://www.sharepointdiary.com/2018/03/sharepoint-online-get-all-documents-using-powershell.html

The code is quite old and won't work but you can get a hum of how to approach this to.

As for Graph API you need to get all Sites, then all libraries in that site, here's some to the API:s you can make use of:
https://learn.microsoft.com/en-us/graph/api/site-list?view=graph-rest-1.0&tabs=http
https://learn.microsoft.com/en-us/graph/api/drive-get?view=graph-rest-1.0&tabs=http
https://learn.microsoft.com/en-us/graph/api/driveitem-list-children?view=graph-rest-1.0&tabs=http


I recommend going the Graph way and doing this in runbook or similar

View solution in original post