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

3 Replies

Hi @Roger Roger 

 

Did you find any solution?

Anyone have any luck finding a solution?

 

About 80% of my files show up in the OneDrive folder on my desktop that are on OneDrive online.  I can open files in the web viewer that don't show up locally, but when I try to open in the Desktop-App I am told the file cannot be found.

It seems like your OneDrive folder on your machine is not sycning with the cloud location. (i.e. it was and now it's not). Do you show sync icons next to the desktop app? I occassionally see users who for some reason (sleep mode???) lose the connection to either OneDrive or SharePoint. A resync fixes the problem. It's very random for me. But it's a common issue. Once a month I'd say.