Fix OneDrive Setup Error 0x8004e4f1

In this blog post, we will look at how to troubleshoot the Your OneDrive has not been set up error with code 0x8004e4f1. If you started seeing this message after changing a user’s sign-in name or domain in Microsoft 365, the checks below will help you confirm that the account is ready and reconnect the OneDrive sync app.

I encountered this issue while changing users sign-in names from one verified domain to another within the same Microsoft 365 tenant. After the change, OneDrive could not complete setup using the new sign-in name. Before making further changes to the account, it is worth checking whether OneDrive works in a browser and whether the problem is limited to the Windows app.

Background

Recently, I was working on migrating users from one domain to another within the same Microsoft 365 tenant. As part of this process, I signed in to the Microsoft 365 admin center and updated the users User Principal Names (UPNs) to use the new domain.

In Microsoft 365, the User Principal Name (UPN) is the sign-in name users typically use to access Microsoft 365 apps and services. A user’s UPN can be different from their primary email address. However, in my scenario, both were the same. For example, a user’s original UPN was xyz@cloudinfra.net, which I changed to xyz@myotherdomain.com. Both domains were already verified and configured within the same Microsoft 365 tenant.

After changing a user’s UPN, it may take some time for the updated sign-in information to propagate across Microsoft 365 services. An important point to note is that changing a user’s UPN does not automatically change their primary SMTP email address in every scenario. If you also want to change the user’s primary email address, you may need to update it separately, depending on how the user account and Exchange Online mailbox are managed.

Once the UPN change has propagated, users may need to sign out and sign back in to Microsoft 365 apps, such as Outlook, Word, Excel, and OneDrive, using their new UPN. In some cases, additional account reconfiguration may be required. In my scenario, most Microsoft 365 apps worked correctly after the UPN change. However, when I attempted to configure OneDrive using the user’s new UPN, the setup failed.

I received the following error message:

Your OneDrive has not been set up. Please get in touch with your IT department.

Error code: 0x8004e4f1

You may also encounter another OneDrive sign-in error with the following message:

There was a problem connecting to OneDrive. Check your Internet connection and try again later.

Error code: 0x8004deed

These errors can occur when OneDrive encounters authentication or account configuration issues after a UPN change. In the next section, I will walk through the troubleshooting steps to resolve these errors and successfully configure OneDrive using the updated UPN.

onedrive has not been setup (Error 0x8004e4f1)

There is no single solution that works in every scenario, but there are several troubleshooting methods you can try to resolve this issue. A user’s OneDrive URL is typically based on their UPN when OneDrive is first provisioned. When the UPN changes, the OneDrive URL may also be updated, and it can take some time for these changes to propagate across Microsoft 365 services.

I recommend scheduling UPN changes on a Friday after business hours, where possible. This gives Microsoft 365 services additional time over the weekend to process the changes and helps reduce potential disruption to users. Refer to the link, which shows how UPN changes affect OneDrive: How UPN changes affect OneDrive – SharePoint in Microsoft 365 | Microsoft Learn.

If you continue to experience issues configuring OneDrive with the new UPN, follow the troubleshooting steps provided in the next sections of this post.

Before proceeding, ensure that any unsynced or unsaved files are backed up to a safe location. Some troubleshooting steps may involve unlinking OneDrive, resetting the sync client, or removing locally stored account information. Taking a backup beforehand will help prevent potential data loss.

Important

What does error 0x8004e4f1 mean?

In the scenario described in this post, the error appeared during OneDrive setup after a UPN change. However, the error code alone does not confirm that a UPN change is the cause.

Microsoft’s current OneDrive error code reference also associates 0x8004e4f1 with a blank page when opening OneDrive settings. It does not provide a single fix for every situation where this code appears.

For this reason, follow the checks that match your symptoms. If you can open OneDrive in a browser but cannot finish setting up the sync app, focus on the local app steps. If browser access also fails, ask your administrator to check the account and service before repeatedly resetting OneDrive.

1. Check OneDrive Access in a Browser

Start by checking whether the user can access their files online. This helps you decide whether to investigate the account or the Windows sync app first.

  1. Open an InPrivate or Incognito browser window.
  2. Go to Microsoft 365 and sign in using the user’s current UPN.
  3. Open OneDrive from the app launcher.
  4. Check whether the files load and whether you can open an existing document.

Use the results to decide what to check next:

ResultWhat to do next
OneDrive opens and the files are accessibleContinue with the local app checks below.
Microsoft 365 sign-in failsAsk your administrator to investigate the sign-in failure before changing the sync app.
Sign-in works, but OneDrive remains on a setup pageCheck the user’s license and OneDrive provisioning.
Several users are affected at the same timeCheck Microsoft 365 service health before making changes to individual devices.

These results can help narrow down the issue, but they do not necessarily confirm the root cause. For example, successfully accessing OneDrive through a web browser does not rule out a policy or configuration issue that may be preventing access through the OneDrive desktop app.

If OneDrive works online but the Windows app still uses the previous sign-in details, you can unlink the affected account and set it up again. Make sure you have saved any unsynced work before continuing.

  • Click the OneDrive cloud icon in the taskbar notification area.
  • Open Settings, then select Account.
Unlink OneDrive from the PC and re-login
  • Select Unlink this PC for the affected account.
Unlink this PC on Onedrive
  • Select Unlink account to confirm.
Unlink account onedrive

Clear Saved Sign-in Configuration

To clear the saved sign-in configuration, follow below steps:

  • Press Win + R, enter the following path, and press Enter:
%localappdata%\Microsoft\OneDrive\settings
  • Delete PreSignInSettingsConfig.json if it is present.
  • Leave the other files and folders in place.
  • Open OneDrive from the Start menu and sign in using the current UPN.
  • Enter your new User Principal Name (UPN) provided by your administrator, then click Sign in to continue setting up OneDrive.
re-login on Onedrive after unlink
  • As you can see, we just signed in successfully using the new UPN address for this user.
OneDrive Sign in progess

3. Reset the OneDrive Sync App

If reconnecting the account does not help, you can reset the sync app. This resets its settings and starts a full sync check. It can also affect other OneDrive accounts configured in the app, so allow time for them to reconnect.

Run the reset in the affected user’s Windows session. You do not need to open Command Prompt or PowerShell as an administrator.

  • Press Win + R to open the Run dialog.
  • Enter the following command and select OK.
%localappdata%\Microsoft\OneDrive\OneDrive.exe /reset

If Windows cannot find the file, try the following installation path instead:

"C:\Program Files\Microsoft OneDrive\OneDrive.exe" /reset

Or

"C:\Program Files (x86)\Microsoft OneDrive\OneDrive.exe" /reset

Open OneDrive from the Start menu if it does not restart automatically. Complete any sign-in prompts and review your folder selections. Your cloud files are retained.

At this stage, you may encounter the error message: “OneDrive can’t be run using full administrator rights. Please restart OneDrive without administrator rights.” This error occurs when OneDrive is launched with elevated administrator privileges. To resolve it, close OneDrive and restart the application normally, without selecting Run as administrator. OneDrive should then launch using your standard user permissions.

Reset OneDrive | Microsoft Support

More Information

4. Reinstall OneDrive if the issue continues

If browser access works and the earlier steps have not resolved the app issue, you can reinstall the current OneDrive sync app. If your organisation manages the installation via Intune, check with your IT team before replacing it.

  1. Open Settings > Apps > Installed apps.
  2. Find Microsoft OneDrive, open its menu, and select Uninstall.
  3. Follow the prompts to remove the app.
  4. Download the sync app from the Microsoft OneDrive download page.
  5. Run the installer, open OneDrive, and sign in with the current UPN.
  6. Complete setup and review the folders selected for synchronisation.

Uninstalling OneDrive stops the app from syncing, but it does not delete the files stored in your online OneDrive. Keep your existing local folder and any copies of unsynced work until you have checked the result.

Check that OneDrive is working again

Once you can sign in, confirm that files are syncing as expected before removing any temporary backup copies. Create a small test file in the local OneDrive folder and check that it appears online. You can then edit the test file in the browser and confirm that the updated version reaches the computer.

Also check that OneDrive no longer displays the setup error and that the folders you need are included in the sync configuration. If you notice duplicate files or missing changes, compare them with your saved copies before deleting anything.

Contact Microsoft Support

If the error continues after these checks, ask your Microsoft 365 administrator to open Help & support in the admin center. Describe the issue and use the contact support option if the suggested guidance does not resolve it. If all your subscriptions were purchased through a partner, contact that partner for support.

  • Sign in to the Microsoft 365 admin center > Support > Help & support.
  • Provide Information on How can we help? pane and create a ticket from there.

Include the following information so the support team can investigate:

  • The full error message and a screenshot.
  • The affected user’s current UPN and the time of any recent change.
  • Whether OneDrive works in an InPrivate browser window.
  • Whether one user or several users are affected.
  • The Windows version and OneDrive app version.
  • The troubleshooting steps already completed.
  • Any request or correlation ID shown with the error, together with the time and time zone.

Clear OneDrive Cache from Credential Manager (Optional)

If OneDrive continues to show the previous account details or asks you to sign in repeatedly, you can check whether Windows Credential Manager contains saved credentials for the affected account. Removing an outdated OneDrive entry may help the app request fresh sign-in details.

Before continuing, save any open documents and close OneDrive. Make sure you complete these steps while signed in to Windows as the affected user.

  • Open Start, search for Credential Manager, and select it from the results.
Credential Manager open from start menu
Credential Manager
  • Select Windows Credentials.
  • Under Generic Credentials, look for entries clearly associated with OneDrive. Depending on the installation, you may see an entry containing OneDrive Cached Credential.
  • Expand the entry and review its details. If you can identify it as belonging to the affected OneDrive account, click Remove and confirm.
  • Open OneDrive from the Start menu.
  • If prompted, sign in using the user’s current UPN and check whether setup completes successfully.
Clear Onedrive cache from Credential Manager
Clear Onedrive cache from Credential Manager

If you cannot find a OneDrive-related entry, you can skip this method and continue with the unlink and reconnect steps. The absence of an entry does not mean that OneDrive has no cached sign-in information.

Make sure you only remove credentials that you can identify as belonging to the affected OneDrive account. Avoid removing unrelated Windows, Office, or network credentials, as this may cause other applications and services to request sign-in again.

This method removes the selected saved credentials; it does not delete your OneDrive files or clear every authentication cache used by the app.

Leave a Comment