Home › Microsoft OneDrive for Business › 0x80070005

Microsoft OneDrive for Business · 0x80070005 · Windows 11 23H2

OneDrive for Business Error 0x80070005 in Windows 11 23H2

Access Denied error due to insufficient NTFS permissions or antivirus interference; fix by resetting sync and adjusting security settings.

Error Details

FactValueSourceNote
Exact error stringE_ACCESSDENIED (0x80070005)%LocalAppData%\Microsoft\OneDrive\logs\SyncEngine.log-> log file
Affected build rangeWindows 11 23H2
Registry key involvedHKLM\SYSTEM\CurrentControlSet\Control\FileSystem\LongPathsEnabled-> for path length issue
Relevant service/endpoint URLhttps://onedrive.live.com/about/en-us/download/
Log line signatureSyncEngine - E_ACCESSDENIED 0x80070005%LocalAppData%\Microsoft\OneDrive\logs\UserTelemetryCache.otc.session

Log Files to Check

What This Error Actually Means

The error code E_ACCESSDENIED (0x80070005) signifies that Microsoft OneDrive for Business is encountering an access denial issue when attempting to read or write a file or folder on the local system or within SharePoint Online. This error typically arises due to insufficient permissions granted to the user account running the OneDrive sync client, either locally on the Windows filesystem or remotely in SharePoint Online. The component that raises this error is primarily the SyncEngine service of OneDrive for Business, which logs detailed information about access denials in the local sync log files.

Affected Versions and Scope

This specific issue affects users running Microsoft Windows 11 build 23H2 with Microsoft OneDrive for Business installed. The error is particularly prevalent when attempting to synchronize data between a user's local OneDrive folder (commonly located at %UserProfile%\OneDrive - ) and the corresponding SharePoint Online library. It does not affect older versions of Windows or other operating systems, nor does it impact users who do not have a configured OneDrive for Business account.

Where To Look First: Logs and Event IDs

To diagnose this issue effectively, start by examining two critical log files:
  • %LocalAppData%\Microsoft\OneDrive\logs\UserTelemetryCache.otc.session
  • %LocalAppData%\Microsoft\OneDrive\logs\SyncEngine.log
Within these logs, search for the exact error string E_ACCESSDENIED 0x80070005. Additionally, review Event ID 2001 in the Application log (Source: OneDrive) to identify access denied entries with file paths and Windows error codes. The following PowerShell cmdlet can be used to retrieve these events:
Get-WinEvent -LogName "Application" | Where-Object { $_.Id -eq 2001 } | Select-Object TimeCreated, ProviderName, Id, Message

Root Causes

Inadequate Local NTFS Permissions

OneDrive sync errors often stem from insufficient permissions on the local OneDrive folder. The user account running OneDrive must have Full Control or at minimum Read & Execute and Modify permissions to ensure seamless synchronization.

Broken SharePoint Inheritance or Unique Permissions

If a SharePoint Online site or library has unique permissions set, it may exclude the user's account from accessing certain files or folders. This can be identified by navigating to the Library settings in SharePoint and checking for 'This library has unique permissions'.

Third-Party Security Software Interference

Antivirus software like Symantec, CrowdStrike, or Windows Defender might lock a file during real-time scanning, preventing OneDrive from reading it. This can be confirmed by reviewing the logs of these security solutions.

File Path Length Exceeding Limits

If the full path to the failing file exceeds 259 characters, it may trigger an access denial due to limitations in older Windows builds. To resolve this, enable long path support via Group Policy or registry settings.
Enabling long paths can introduce security risks if not properly managed.

Fix Procedure

  1. Check OneDrive Sync Errors: Right-click the OneDrive icon in the taskbar > View sync errors to identify files with error code 80070005.
  2. Adjust Local NTFS Permissions: Open File Explorer, right-click the OneDrive folder > Properties > Security. Ensure the signed-in Windows user has Full Control or at minimum Read & Execute and Modify permissions.
  3. Review SharePoint Online Permissions: Navigate to the SharePoint library in a browser > Settings (gear icon) > Library settings > Permissions for this document library. If unique permissions are set, confirm the user's access level and re-grant if necessary.
  4. Check for File Locks: Open Resource Monitor (resmon.exe) > CPU tab > Associated Handles to identify which process has the file open. Close the application locking the file.
  5. Enable Long Path Support: If the path exceeds 259 characters, enable long paths via Group Policy or registry: HKLM\SYSTEM\CurrentControlSet\Control\FileSystem\LongPathsEnabled.
  6. Reset OneDrive Sync: Right-click OneDrive taskbar icon > Help & Settings > Quit OneDrive. In Run dialog: %localappdata%\Microsoft\OneDrive\onedrive.exe /reset. Wait 2 minutes for OneDrive to restart automatically.
  7. Exclude from Antivirus Scanning: Exclude the OneDrive folder from real-time scanning in Microsoft Defender, CrowdStrike, or Symantec settings.

Error Code Variants

Error Code Description Distinguishing Features
E_ACCESSDENIED (0x80070005) Access Denied due to insufficient permissions. Logs indicate specific file paths and access denials.
E_FILENOTFOUND (0x80070002) File not found error indicating missing files or directories. No file path is provided in the logs, only a generic message.
E_INVALIDARG (0x80070057) Invalid argument passed to OneDrive API calls. Error messages indicate incorrect parameters or malformed requests.

Verification

To ensure the fix has been applied successfully, monitor the following:
  • OneDrive Status: Right-click the OneDrive taskbar icon — the 'Up to date' status should appear with a green tick.
  • Synchronization Errors: Check View sync errors in the OneDrive settings for no 80070005 entries.

Prevention

Implementing baseline changes can prevent recurrence of this issue:
  • Policy Enforcement: Use Intune to enforce NTFS permissions on all user profiles, ensuring the OneDrive folder has Full Control for each user.
  • Security Software Configuration: Configure third-party security software to exclude real-time scanning of the OneDrive local folder.
Use Get-MgDeviceManagementManagedDevice -Filter "deviceEnrollmentType eq 'windowsAutoEnrollment'" to identify devices with specific enrollment types for targeted policy enforcement.

Sources & References

Get new error code fixes by email

Product-specific solutions for Intune, Autopilot, SCCM and Entra ID — straight to your inbox. No spam.