Oftentimes, organizations make decisions to transfer files from a particular employee’s OneDrive account to another. However, it’s not an easy task to copy OneDrive files to another OneDrive account PowerShell because of the complexities involved. Users need to be technically sound if they want to perform this task without facing any errors.
In this article, we’re going to discuss the various aspects that users need to consider before undergoing such a project. The manual method of PowerShell, its limitations & the modern method is also covered in this write-up. If you’re planning to execute this operation, read this complete article to understand all minor & major details regarding our topic.
PowerShell Script to Move Files from OneDrive to Another – Things to Consider
- It’s a Long Drawn Out Process
This is a complex approach & it may take a while to complete the process. If you want to transfer thousands of files, then it can take months and maybe even years. In that case, most of the users shift to using the modern approach.
- Files Larger Than 250MB Can’t Be Transferred
If you have files larger than 250MB & you want to transfer that to SharePoint using PowerShell, then it is not possible at any cost. It can make a list of such files and then export it to c:\temp\largefiles.txt if users want to transfer them manually.
- You Must Have A Strong Internet Connection
This method downloads the files in order to move them to another users’ OneDrive account. This method requires a strong internet connection to make the downloading process fast. Therefore, a slow connection can make you leave the running project on a cloud-hosted VM. - Forget Two Factor Authentication
An MFA(multi-factor authentication) on the admin account won’t work with this script. Users need to create an Interim Administrator to perform the task.
The crux of the Matter
Download the following PowerShell modules to copy OneDrive files to another OneDrive account PowerShell:
- MSOnline V1 Powershell Module
Users need to download the MSOnline V1 Powershell Module to operate on this script without error.
To download it, Run the below-mentioned PowerShell cmdlet as an admin-
Install-Module MSOnline -Force - SharePoint Online Management Shell
Install this module to move or change users’ OneDrive site collections permissions. A very crucial step to follow.
Download it from Microsoft’s site: microsoft.com/en-au/download/details.aspx?id=35588
- SharePoint PnP Powershell Module
This SharePoint PnP Powershell Module gives users the cmdlets that they have to use to migrate data files between different accounts.
To download it, Run the below mentioned PowerShell cmdlet as an admin-
Install-Module SharePointPnPPowerShellOnline -Force
Use PowerShell Script to Move Files to OneDrive
To transfer all OneDrive files to another user via PowerShell follow the below-mentioned steps carefully:
- Open the Vs code/PowerShell ISE & then run the commands present in the images at the end of this section. [Press F5 to run the cmdlets]
- Enter the information stated below & follow the prompts:
- Enter Departing users’ Username
- Put Destination users’ username
- Office 365 administrator credentials
- Lage files can’t be transferred and you can find a list of those files in c:\temp\largefiles.txt
- Wait till the system creates folders and files.
- After successful completion, the destination user can find all the files in its Onedrive account under a subfolder > “Initial User” files.
[Note- Here Initial user is the name of the departing user’s account]
PowerShell script to move files to OneDrive:
Drawbacks of Using the Traditional Approach
There are various limitations of this traditional method. Users can use the PowerShell script to move files from OneDrive to another but they must know the limitations first.
- When users need to migrate files in bulk, a manual method is not a reliable option.
- Users can’t migrate data files larger than 250MB if they opt for the manual method. They have to select any other option.
- There is no feature of selective migration. Therefore, users have to migrate all data without filtering the necessary crucial files.
- Users need to manage the migrated data in the destination as folder hierarchy can’t be maintained if you execute manual methods.
What Is the Most Reliable Method We Have?
Now, as we’ve discussed the limitations of the PowerShell method. You must be curious to know the best option to transfer all OneDrive files to another user via PowerShell. Organizations are accepting the modern approach, download Top Rated OneDrive to OneDrive Migration Tool for a smooth & fluent migration operation.
This tool is developed using advanced algorithms that can handle all the technicalities involved at its end. Moreover, it provides some extra beneficial features like date-filter, Delta migration, the ability to migrate document’s permissions, etc. This tool comes with an easy-to-use GUI that makes working easy for users.
Conclusion
Finally, We are done discussing the PowerShell method, its limitations, and the modern approach for user queries. If you want to copy OneDrive files to another OneDrive account PowerShell, you know what to do now. If you go through this complete article, you can execute this Onedrive migration task using the traditional approaches. However, it is not recommended by IT experts.
A quick go-through of this write-up, a few days prior to your migration project can provide you a clear insight to select the correct approach and tool. The above-mentioned tool is the best & reliable approach to execute this operation without facing any hassles.