OneDrive Missing Files and Folders

%3CLINGO-SUB%20id%3D%22lingo-sub-2386172%22%20slang%3D%22en-US%22%3EOneDrive%20Missing%20Files%20and%20Folders%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2386172%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20All%3C%2FP%3E%3CP%3Ei%20have%20a%20user%20who%20reported%20that%20some%20of%20the%20folders%2Ffiles%20in%20his%20OneDrive%20are%20missing.%20I%20want%20to%20export%20all%20the%20files%20and%20folders%20names%20from%20users%20onedrive%20to%20an%20excel%20sheeting%20using%20PowerShell.%20I%20am%20able%20to%20export%20the%20contents%20of%20users%20OneDrive%20recycle%20bin%20using%20the%20below%20syntax%20not%20sure%20how%20to%20export%20to%20OneDrive%20files%20and%20folders%20to%20csv%20file.%3C%2FP%3E%3CP%3E%24SiteURL%20%3D%20%22%3CA%20href%3D%22https%3A%2F%2Fcontoso-my.sharepoint.com%2Fpersonal%2FJohn_A_contoso_com%2F_layouts%2F15%2Fonedrive.aspx%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Ehttps%3A%2F%2Fcontoso-my.sharepoint.com%2Fpersonal%2FJohn_A_contoso_com%2F_layouts%2F15%2Fonedrive.aspx%3C%2FA%3E%22%3CBR%20%2F%3EConnect-PnPOnline%20-Url%20%24SiteURL%20-Credentials%20(Get-Credential)%3CBR%20%2F%3EGet-PnPRecycleBinItem%20%7C%20Export-Csv%20C%3A%5Ctemp%5Coutput.csv%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2386172%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAdmin%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EOneDrive%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EPowerShell%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%20Online%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESites%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
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