Background
Recently, I was working on migrating users from one domain to another. To migrate the users to the new domain, I logged on to the Microsoft 365 admin center and updated their User Principal Name (UPN) to the new domain.
In Microsoft 365, the UPN (User Principal Name) is what users use to sign in to their devices, and it can be different from their email address. In my scenario, UPN and email address were same.
For example, a user’s old UPN was xyz@cloudinfra.net, later modified to xyz@myotherdomain.com. Both of these domains are verified domains within the same Microsoft 365 tenant.
Modifying the primary email address and UPN typically takes a few hours to propagate in the backend. When you change a user’s UPN, their primary SMTP email address will automatically change to match the user’s UPN.
Following this change, you can ask users to reconfigure Outlook and Microsoft 365 apps such as Word and Excel and prompt them to reconfigure OneDrive.
The modification should function correctly with all other Microsoft 365 apps except OneDrive. During the reconfiguration of the user’s device, it became apparent that OneDrive could not be set up with the user’s new UPN address.
I received the error message: Your OneDrive has not been set up. Please get in touch with your IT department (Error code: 0x8004e4f1).
You might also encounter an error message suggesting a problem connecting to OneDrive. Check your Internet connection and try again later (Error Code: 0x8004deed).
There isn’t a straightforward solution to this issue, but we can explore several troubleshooting approaches. The user’s OneDrive URL is associated with their UPN, which changes when the user’s UPN is modified.
It is advisable to make UPN changes on Friday at the end of the business day. This allows the changes to propagate in the backend over the weekend, reducing the likelihood of user issues.
If you continue to encounter problems with setting up OneDrive using the new UPN, please follow these troubleshooting steps:
Before proceeding, be sure to back up any unsynced or unsaved files, as troubleshooting OneDrive could potentially result in data loss if you have unsaved work.
Note
Contents
Clear OneDrive Cache from Credential Manager
Clear OneDrive credential cache on the Windows device using the Credential Manager. This cache stores OneDrive credentials used to sign in to the OneDrive application. It might still contain the old credentials from before the UPN change. Here are the steps to follow:
- Log in to the Windows device and click on Start.
- Search for Credential Manager.
- Click on Windows credentials and find OneDrive cookie/cached credentials. Click on Remove to delete the credentials from your device and try again.
Unlink OneDrive from the PC and re-login
Another option is to Unlink OneDrive from the OneDrive settings. This allows you to log in again using the user’s new UPN.
- Go to OneDrive in the system tray and click the Settings icon.
- Click on Account > Unlink this PC.
- Click on the Unlink account button on the option Unlink account on this PC?.
- Sign in to OneDrive using the new UPN address provided by the administrator. Then click on the Sign-in button to continue.
- As you can see, we just signed in successfully using the new UPN address for this user.
Reset OneDrive application
If you continue to experience problems logging into the OneDrive application and encounter the OneDrive setup error, you can attempt to reset the application using the following steps:
- Launch PowerShell or command prompt as an administrator.
- Change directory to C:\Program Files\Microsoft OneDrive, where the OneDrive app is installed.
- Type the command
Onedrive.exe /reset
to reset this application.
You may get an error message at this stage, OneDrive can’t be run using full administrator rights. Please Restart OneDrive without administrator rights. This means that OneDrive could not be started automatically, you can start the OneDrive application as a normal user.
https://support.microsoft.com/en-us/office/reset-onedrive-34701e00-bf7b-42db-b960-84905399050c
More Information on Reset OneDrive
Re-link the User’s UPN using PowerShell
You can also try to re-link or update/refresh the user’s UPN to the new UPN using the following PowerShell cmdlets. Please remember that any Microsoft 365 user account changes may take a couple of hours to propagate. I recommend waiting for at least 24 hours before trying again.
#Install ExchangeOnline Powershell Module Install-Module -Name ExchangeOnlineManagement #Connect to Exchange Online Connect-ExchangeOnline #Refresh User's UPN to New UPN Set-MsolUserPrincipalName -UserPrincipalName "jatin.makhija@cloudinfra.net" -NewUserPrincipalName "jatin.makhija@newdomainname.com"
Download Latest version of OneDrive and Reinstall
Another approach is to uninstall the old version of OneDrive and upgrade to the latest version, including bug fixes and the latest features. You can download the latest version from the following link: https://www.microsoft.com/en-gb/microsoft-365/onedrive/download.
Raise a Support Ticket with Microsoft
If you continue to experience issues with OneDrive, and it’s not setting up for users, you can also open a support ticket with Microsoft from the Microsoft 365 admin center. To create a support ticket for Microsoft support, follow these steps:
- Log in to the Microsoft 365 admin center > Support > Help & support.
- Provide Information on How can we help? pane and create a ticket from there.
Conclusion
In this blog post, we’ve explored various approaches to troubleshoot OneDrive setup issues. While there is no straightforward solution, even though it’s a known issue, the exact cause remains unclear. This problem typically arises when you change a user’s UPN, which can impact OneDrive.
Usually, allowing the change to propagate for 24 hours often resolves the issue. If the problem persists, follow the troubleshooting steps in this blog post.