0x8004e4f1 OneDrive Error Code: How To Fix It

This is caused by the domain name being changed

Reading time icon 5 min. read

Readers help support Windows Report. We may get a commission if you buy through our links. Tooltip Icon

Read our disclosure page to find out how can you help Windows Report sustain the editorial team Read more

Key notes

  • 0x8004e4f1 OneDrive error code occurs when the User Principal Name (UPN) is changed with a new email address. 
  • Removing the OneDrive credential cache and re-linking the User UPN should help fix the error code. 


Signing up and using the Microsoft 365 apps, including OneDrive on Windows PC, is a matter of seconds. However, several users have been encountering an error message: Your OneDrive has not been set up. For help, contact your IT department. followed by the error code 0x8004e4f1. 

The error code 0x8004e4f1 indicates an explicit sign-in scenario that can be easily resolved by the solutions listed in this guide. 

Why do I get the 0x8004e4f1 OneDrive error code?

The 0x8004e4f1 error code occurs when the User Principal Name (UPN) commonly known as the email domain address of Microsoft 365, is replaced with a new domain. 

For the uninitiated, UPN or email domain is a default attribute required for generating the email address, which like an email address, can be used to sign in to Windows devices. 

To uncomplicate the process, users usually prefer to have the same UPN and email address but can be changed if necessary. For instance, The old UPN [email protected] can be changed to [email protected]. However, it is important to ensure that both of these domains should belong to the same Microsoft 365 tenant.

When the changes are made to the UPN, the primary email address (SMTP) automatically updates itself to match the UPN, but the process is time taking.

To tackle this, users can explicitly set up all Microsoft 365 apps from scratch. Unfortunately, the procedure accomplishes the desired results for all the Microsoft apps, excluding OneDrive. As a result, you are interrupted by the error code 0x8004e4f1 during the setup process. 

How do I fix the 0x8004e4f1 OneDrive error code? 

Before you try the advanced troubleshooting steps, here are some preliminary steps you should perform the fix the issue: 

  • Wait for an hour or two to ensure that the domain change has been propagated to access the network. 
  • Check the OneDriver server status and see if it is up and running. 
  • Temporarily disable Windows Defender or a third-party antivirus
  • Uninstall the MS Office 365 app and download and install it from the official website. 

If these workarounds do not help, jump to the solutions listed below.

1. Clear OneDrive credential cache 

  1. Press the Windows key, type credential manager in the search bar, and choose the relevant search result. 0x8004e4f1
  2. Switch to the Windows credentials tab on the Manage your credentials window. 
  3. Look for the OneDrive cached credentials under the Generic Credentials section and click to view the related settings. 0x8004e4f1
  4. Click Remove to delete the OneDrive credential cache0x8004e4f1
  5. Press the Yes button on the confirmation pop-up that appears. 

The credential cache of OneDrive maintained by the Credential Manager is the primary reason for the 0x8004e4f1 error. Removing this Windows Credentials cache prove to be an easy fix. 

  1. Press the Windows key, type powershell in the search bar on top, and select the Run as administrator option from the search result. 0x8004e4f1
  2. Click Yes on the User Action Control dialog box to launch Windows PowerShell with elevated permissions. 
  3. Type or paste the following command in the PowerShell window and press the Enter key to execute the command. Press Y if prompted to change the execution policy. Set-ExecutionPolicy RemoteSigned 0x8004e4f1
  4. Now type or paste the following commands one by one and press the Enter key after each of them. Add the old email address and new email address in their respective placeholders. Install-Module -Name ExchangeOnlineManagement -Force Import-Module ExchangeOnlineManagement Connect-ExchangeOnline Set-MsolUserPrincipalName -UserPrincipalName old email address -NewUserPrincipalName new email address

As reported by several Microsoft users, using Windows PowerShell to re-link the old user UPN to a newly generated one resolves the Ox8004e4f1 error code such that the OneDrive setup is successful. 

However, it might take several hours for the changes to show up for your Microsoft 365 account. Hence you should skip 24 hours and attempt to sign into the OneDrive app. 

3. Create a new OneDrive account 

  1. Visit the signup webpage of OneDrive from your preferred web browser and follow the Create one link. 0x8004e4f1
  2. Enter a new email address in the text box or click the Use a phone number instead option and press the Next button. 0x8004e4f1
  3. Provide a new password in the Create a password field and press Next
  4. Follow the step-by-step process to create a new user account for the OneDrive app. 

You may also struggle with OneDrive if your user account has become corrupt. Creating a new user account to step up OneDrive will help fix the 0x8004e4f1 error code. 

4. Reset OneDrive 

  1. Use the Windows + R shortcut key to launch the Run dialog box.
  2. Copy and paste the following path in the text box and press Enter to reset the OneDrive app. %localappdata%\Microsoft\OneDrive\onedrive.exe /reset 0x8004e4f1
  3. As soon as you will execute the command, the OneDrive icon in the notification tray will blink and re-appear. 
  4. Resetting OneDrive to the default values may take some time. Once complete, relaunch and set up the OneDrive app; the 0x8004e4f1 will no longer interrupt the process.

Hopefully, you could successfully troubleshoot the error code 0x8004e4f1 such that the setup process is complete.

In case, the error persists, you should uninstall OneDrive from your Windows PC and reinstall it by following the step-by-step process mentioned in this guide. 

If you have any comments, feedback, or solutions for us, do let us know in the comments section. 

More about the topics: onedrive