Move-PnPFile from a site to personal onedrive site #667
Replies: 3 comments 4 replies
-
Hi This looks very similar to this discussion question: #620 (comment). You could use the concept in my post linked above in reverse to add the files to stream objects to migrate from SP to OneDrive. |
Beta Was this translation helpful? Give feedback.
-
Hello everyone, I have the same problem and have found no solution... I have also tried using the same command as #3215 , but it gives me the What is the version of the Cmdlet module you are running? Thanks for the help :) |
Beta Was this translation helpful? Give feedback.
-
It works for me, but from SharePoint to OneDrive. The main command to use is first make sure you connect to both sites, the sharepoint and the onedrive, and save these connnections
then use the following command: the $file.ServerRelativeUrl looks like: Shared Documents/2023/Folder1 the $TargetFolderPath looks like: https://mydomain-my.sharepoint.com/personal/user_mydomain_com/Documents/Projects/Operations/X1/X2 |
Beta Was this translation helpful? Give feedback.
-
I'm trying to move some files from SharePoint Online Site to a user OneDrive for business. This feature is available on SharePoint online web interface, but it will be easier to do it using PowerShell codes.
Move-PnPFile -SourceUrl "/sites/TestSite/Shared Documents/General/Agreement.doc" -TargetUrl "/personal/testuser_testdomain_com/Documents" -AllowSchemaMismatch -AllowSmallerVersionLimitOnDestination
it failed saying
The remote server returned an error: (404) Not Found
.I feel that the reason behind this failure the base URL that I used to connect.
Beta Was this translation helpful? Give feedback.
All reactions