OneDrive URLs are generated based on a user's UPN.
By changing the user's username or designating a different email alias as the primary, you can modify a user's UPN in the Microsoft 365 admin center.
Please note: It may take several hours for UPN updates to propagate across your environment.
If you are altering a lot of UPNs in your company, change them in batches to lessen the burden on the system.
Apply changes if you can, preferably before the weekend or at off-peak times, to give them time to take effect and avoid interfering with your users' workflow.
How does it affect User’s access
Any links to the user's OneDrive that have been preserved (such as browser favorites or desktop shortcuts) will stop working once you change a UPN and need to be changed.
After a UPN update, the sync app (on Windows and Mac) will immediately switch to sync with the new OneDrive location.
Users may get the error "One or more libraries could not be synced" in the OneDrive sync app while the UPN modification is updating throughout their environment.
They may encounter "You don't have authorization to sync this library" if they click for additional details.
Users should restart the sync app if they encounter this problem.
How to fix it
Users must browse to reopen OneDrive files in their new location after the UPN change in order to access them.
Links to the files will no longer function, including bookmarks in browsers, desktop shortcuts, and "Recent" lists in Office software and Windows.
How does it affect file sharing
After a UPN modification, links to OneDrive files that a user has shared with others would no longer function. The user must share the files again.
View from the Admin Center
The user's original UPN will remain visible in the Office Backstage View even though Office will continue to function as expected after a UPN update.
The user must sign out and then sign back in using the Office client in order for the Office Backstage View to reflect the modified UPN.