Powershell Script to get a list of onedrives items

Jacobo Garrido 60 Reputation points
2023-01-25T12:58:12.9533333+00:00

Hi Team,

I am very new in a Powershell world but I need a Script to recopilate all the files and the folders of some users, by CSV of user by user.

Could you help me please?

Many Thanks

Microsoft 365 and Office Install, redeem, activate For business Windows
Exchange Exchange Server Management
Microsoft 365 and Office SharePoint For business Windows
Microsoft 365 and Office OneDrive For business Windows
{count} votes

2 answers

Sort by: Most helpful
  1. Jacobo Garrido 60 Reputation points
    2023-01-27T07:54:06.1266667+00:00

    Hi @AllenXu-MSFT

    I am so sorry for my bad explication. I work with Sharepoint Online. I need to get by Powershell a CSV File data and folders of onedrive Users.

    For example, I have the ******@domain.com and I need to know your OneDrive Storage. How many folders he has, how many folders he has, how many items they have, the name of the folders and the files and the size of them.

    Thank you for your support

    0 comments No comments

  2. AllenXu-MSFT 24,941 Reputation points Moderator
    2023-02-01T08:12:30.95+00:00

    @Jacobo Garrido ,

    I can find the PowerShell code to fetch OneDrive Storage Metrics Report. Please see this article: Get OneDrive Storage Metrics Report with PowerShell. As to get the detailed information like file name, folder name, I'm afraid no such interface can be used to fetch them as per my knowledge.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.