OneDrive error 0x8004def7 usually appears when you try to sign in or sync files, and it means Windows or Office can’t validate your account credentials. The fix is to clear your cached credentials, reset OneDrive, and re-authenticate — here’s the exact step-by-step process that works for most people.
What Causes Error 0x8004def7?
This error is tied to authentication failures. OneDrive uses your Microsoft account token to verify who you are. When that token becomes stale, corrupted, or blocked by a proxy or VPN, Windows throws 0x8004def7. Common triggers include:
- Recently changed Microsoft account password (the old token is still cached)
- Corporate network or VPN that blocks OneDrive’s login servers
- Corrupted credential manager entries
- OneDrive app itself is outdated or its cache is damaged
- Windows registry permissions that prevent OneDrive from writing its state
It’s not a sign of a damaged file or a virus — it’s almost always an authentication handshake problem.
Before You Start: Quick Checks
Try these two things first because they take under a minute and sometimes resolve the error immediately.
- Restart OneDrive: Right-click the OneDrive cloud icon in the system tray (bottom-right near the clock) and choose Exit. Then reopen OneDrive from the Start menu.
- Check your internet connection: Open a browser and go to
onedrive.com. If you can sign in there, your account is fine — the problem is local. If you can’t, you have a network or account issue, not an app issue.
If the error persists, move on to the full reset below.
Step-by-Step Fix for 0x8004def7
Follow these steps in order. Stop when the error disappears.
Step 1: Clear Windows Credential Manager
Windows stores your OneDrive password in Credential Manager. A stale entry there is the #1 cause of 0x8004def7.
- Press Win + R, type
control /name Microsoft.CredentialManager, and press Enter. - Click Windows Credentials.
- Look for any entry that starts with
OneDrive Cached Credentialor containsMicrosoftOffice16orMicrosoft.OneDrive. - Click the entry and choose Remove. Confirm when prompted.
If you see several, remove them all. This does not delete your files — only the saved login token.
Step 2: Reset OneDrive Completely
This clears the local cache and forces OneDrive to rebuild its sync database.
- Press Win + R, paste this command, and press Enter:
%localappdata%\Microsoft\OneDrive\onedrive.exe /reset - A black window may flash. Wait 30–60 seconds. The OneDrive icon should reappear in the tray.
- If it doesn’t reappear, run this instead:
%localappdata%\Microsoft\OneDrive\onedrive.exe
This doesn’t delete your files, but it will re-sync everything. Large libraries may take a while.
Step 3: Re-Link Your Account
- Right-click the OneDrive tray icon → Settings → Account tab.
- Click Unlink this PC and confirm.
- Close OneDrive, reopen it, and sign in again with your Microsoft account.
If you don’t see the Unlink option (older versions), you can unlink via Settings → Account → Unlink.
Step 4: Disable Proxy or VPN Temporarily
Corporate proxies and VPNs often interfere with OneDrive’s token refresh. Temporarily disconnect from your VPN and see if the error goes away. If it does, add OneDrive to your VPN’s split-tunnel exceptions or contact your IT admin.
Step 5: Repair Office (if you use Office 365)
Because 0x8004def7 also appears in Office apps when they try to connect to OneDrive, a broken Office installation can cause it.
- Open Control Panel → Programs → Programs and Features.
- Find Microsoft 365 or Office, click it, and choose Change.
- Select Quick Repair first. If that doesn’t help, use Online Repair (needs internet).
Step 6: Check Windows Registry (Advanced)
If nothing else works, a registry key may be blocking OneDrive. This is rare but documented.
- Press Win + R, type
regedit, and press Enter. - Navigate to:
HKEY_CURRENT_USER\Software\Microsoft\OneDrive - Look for a value named
DisablePersonalSync. If it exists and is set to1, double-click it and change it to0. - Restart OneDrive.
Only touch the registry if you’re comfortable — a wrong edit can cause other issues. Back up the key before changing anything.
What to Do If the Error Persists
If you’ve done all the above and still see 0x8004def7, the problem is likely on the server side or tied to your Microsoft account itself. Try:
- Sign in to account.microsoft.com and check for any security alerts or password change prompts.
- Wait a few hours — Microsoft occasionally has authentication outages.
- Create a new Windows user profile and try OneDrive there. If it works, your original profile is corrupted.
In rare cases, a full Windows reset (keeping your files) resolves it, but that’s a last resort.
How to Prevent This Error in the Future
- Always sign out of OneDrive before changing your Microsoft account password.
- Keep OneDrive updated — it auto-updates, but you can force check via Settings → About.
- Avoid using VPNs that route all traffic through a foreign country; use split tunneling.
- Periodically clear old credentials in Credential Manager (every few months).
Frequently Asked Questions
Will resetting OneDrive delete my files?
No. The /reset command only clears the local cache and sync database. Your actual files remain on your hard drive and in the cloud. After reset, OneDrive re-downloads the file list and syncs from scratch.
Why does this error happen after I change my Microsoft password?
Windows stores your old password token in Credential Manager. When you change the password, the old token becomes invalid, and OneDrive fails to refresh it automatically. Clearing the cached credential forces a new login.
Does this error affect my Office files?
Yes, it can. If Office apps are connected to OneDrive, they may show the same error when trying to open or save files. Fixing OneDrive usually fixes Office too, because they share the same authentication system.
Is 0x8004def7 a sign of a virus?
No. It’s a standard authentication error. However, if you’re concerned, run a Windows Defender scan to be safe, but the error itself is not malware-related.
Can I fix this on a Mac?
Yes, but the steps differ. On Mac, you would quit OneDrive, delete the credentials from Keychain Access (search for “OneDrive”), and re-launch the app. The Windows-specific registry and Credential Manager steps don’t apply.
Related
General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.
More in this bed
- Fix 0x80070005 DISM Error & the 0x800070005 Typo
- Fix Access Denied Adding Shared Printer in Windows 10
- How to Play Minesweeper: Rules, Tips, and Winning Strategy
- Browser SQL Sandbox for Games: Build Guide
- Snapchat Face Swap: Step-by-Step Guide
- Fix a Computer Chair Height Adjuster: Step-by-Step