Your Onedrive has not been Setup (Error 0x8004e4f1)


Recently I was working on migration of users from one domain to another. Therefore, to migrate the users over to the new domain, I simply logged on to Microsoft 365 admin center and updated users User principal Name (UPN) to the new one.

In Microsoft 365, the UPN (User Principal Name) is what users use to sign in to their devices, and it can be distinct from their email address. However, in my situation, both the UPN and the email address of the user are the same.

For instance, a user’s old UPN was “,” which was later modified to “” Both of these domains are verified domains within the same Microsoft 365 tenant.

This modification of the primary email address and UPN typically takes a few hours to propagate in the backend. When you alter a user’s UPN, their primary SMTP email address will automatically change to match the user’s UPN.

Following this change, you can ask the user to reconfigure Outlook, Microsoft 365 apps such as Word and Excel, and also prompt them to reconfigure OneDrive.

The modification should function correctly with all other Microsoft 365 apps, except for OneDrive. During the reconfiguration on 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. For assistance, please contact your IT department (Error code: 0x8004e4f1)”. You might also encounter an error message stating, “There was a problem connecting to OneDrive. Check your Internet connection, and then try again later (Error Code: 0x8004deed)”.

onedrive has not been setup (Error 0x8004e4f1)
onedrive has not been setup (Error 0x8004e4f1)

There isn’t a straightforward solution to this problem, but we can explore several different approaches to troubleshoot it. The user’s OneDrive URL is associated with their UPN, and this URL changes when the user’s UPN is modified.

It’s advisable to make UPN changes at the end of the business day on a Friday. This allows the changes to propagate in the backend over the weekend, reducing the likelihood of issues for users.

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.


1. Clear Onedrive cache from Credential Manager

The initial step is to clear the OneDrive credential cache on your Windows device using the Credential Manager. This cache stores OneDrive credentials used for signing in to the OneDrive application. It might still contain the old credentials from before the UPN change. Here are the steps to follow:

  • Login on the Windows device and click on Start.
  • Search for Credential Manager.
Credential Manager open from start menu
Credential Manager
  • Go to Windows credentials and search for OneDrive cookie / cached credentials. Click on Remove to delete the credentials from your device.
Clear Onedrive cache from Credential Manager
Clear Onedrive cache from Credential Manager

Another option is to unlink OneDrive from the OneDrive settings. This will give you the option to log in again using the new UPN of the user.

  • Go to Onedrive in system tray and then click on Settings icon.
Unlink OneDrive from the PC and re-login
Unlink OneDrive from the PC and re-login
  • Click on Account > Unlink this PC
Unlink this PC on Onedrive
Unlink OneDrive from the PC and re-login
  • Click on Unlink account button on the option “Unlink account on this PC?“.
Unlink account onedrive
Unlink OneDrive from the PC and re-login
  • Sign in to OneDrive using the new UPN address provided by the administrator. Click on the “Sign in” button to continue.
re-login on Onedrive after unlink
Unlink OneDrive from the PC and re-login
  • As you can see we just signed in using the new UPN address for this user successfully.
OneDrive Sign in progess
Unlink OneDrive from the PC and re-login

3. 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.
  • Navigate 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.

OneDrive can't be run using full administrator rights. Please restart OneDrive without administrator rights.
OneDrive can’t be run using full administrator rights

More Informaiton on Reset OneDrive

You can also try to re-link or update/refresh the user’s UPN to the new UPN using the following PowerShell cmdlets. Please keep in mind that any changes to a Microsoft 365 user account 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

#Refresh User's UPN to New UPN
Set-MsolUserPrincipalName -UserPrincipalName "" -NewUserPrincipalName ""

5. Download Latest version of OneDrive and reinstall

Another approach is to uninstall the old version of OneDrive and upgrade to the latest version, which will include bug fixes and the latest features. You can download the latest version from the following link:

6. 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:

  • Login on Microsoft 365 admin center.
  • Go Support link on the left-hand side menu> New Service request.
  • Provide Information on How can we help? pane and create a ticket from there.


In this blog post, we’ve explored various approaches to troubleshoot OneDrive setup issues. While there is no straightforward solution, and 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 on its own. If the problem persists, you can follow the troubleshooting steps provided in this blog post.

Leave a Comment