Looking to generate Powershell script to copy/move files from ODFB to Sharepoint Online Site

%3CLINGO-SUB%20id%3D%22lingo-sub-1980972%22%20slang%3D%22en-US%22%3ELooking%20to%20generate%20Powershell%20script%20to%20copy%2Fmove%20files%20from%20ODFB%20to%20Sharepoint%20Online%20Site%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1980972%22%20slang%3D%22en-US%22%3E%3CP%3EAs%20a%20PS%20Noob%2C%20I%20have%20been%20fighting%20a%20script%20for%20a%20couple%20days.%3CBR%20%2F%3E%3CBR%20%2F%3EAs%20part%20of%20our%20User%20Deprovisioning%2C%20we%20need%20to%20move%20all%20data%20from%20the%20Users%20OneDrive%20to%20a%20DigitalArchive%20site%20in%20Sharepoint%20Online.%3CBR%20%2F%3E%3CBR%20%2F%3EI%20have%20been%20able%20to%20script%20access%20to%20ODFB%20and%20transfer%20files%20to%20a%20local%20CIFS%20Share.%3CBR%20%2F%3EI%20have%20been%20able%20to%20script%20access%20to%20SPOnline%20to%20create%20new%20folder%20structures%20in%20the%20Site.%3CBR%20%2F%3EWhere%20i%20am%20failing%20is%20connecting%20the%20two%20processes.%3CBR%20%2F%3E%3CBR%20%2F%3EI%20have%20tried%20Add-PnPFile%2C%20Copy-PnpFile%20and%20Move-PnPFolder%20but%20it%20seems%20that%20I%20can%20only%20authenticate%20to%20one%20resource%20at%20a%20time%20which%20causes%20a%20failure%20of%20the%20process.%3CBR%20%2F%3E%3CBR%20%2F%3EI%20figure%20that%20because%20this%20can%20be%20done%20manually%2C%20there%20should%20be%20an%20underlying%20Process%2FUtility%20that%20will%20provide%20access%20and%20all%20the%20functionality%20required.%3CBR%20%2F%3E%3CBR%20%2F%3ECan%20anyone%20suggest%20a%20solution%3F%3CBR%20%2F%3EMany%20thanks%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1980972%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EOneDrive%20for%20Business%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Occasional Visitor

As a PS Noob, I have been fighting a script for a couple days.

As part of our User Deprovisioning, we need to move all data from the Users OneDrive to a DigitalArchive site in Sharepoint Online.

I have been able to script access to ODFB and transfer files to a local CIFS Share.
I have been able to script access to SPOnline to create new folder structures in the Site.
Where i am failing is connecting the two processes.

I have tried Add-PnPFile, Copy-PnpFile and Move-PnPFolder but it seems that I can only authenticate to one resource at a time which causes a failure of the process.

I figure that because this can be done manually, there should be an underlying Process/Utility that will provide access and all the functionality required.

Can anyone suggest a solution?
Many thanks


0 Replies