OneDrive Missing Files and Folders

Frequent Contributor

Hi All

i have a user who reported that some of the folders/files in his OneDrive are missing. I want to export all the files and folders names from users onedrive to an excel sheeting using PowerShell. I am able to export the contents of users OneDrive recycle bin using the below syntax not sure how to export to OneDrive files and folders to csv file.

$SiteURL = "https://contoso-my.sharepoint.com/personal/John_A_contoso_com/_layouts/15/onedrive.aspx"
Connect-PnPOnline -Url $SiteURL -Credentials (Get-Credential)
Get-PnPRecycleBinItem | Export-Csv C:\temp\output.csv

0 Replies