Error Details
| Fact | Value | Source | Note |
|---|
| Exact error string | Access Denied. You don't have permission to perform this action or access this resource. | SharePoint page body | -> Correlation ID |
| Affected build range | Microsoft 365 | OS build | |
| Registry key/OMA-URI involved | | | |
| Relevant service/endpoint URL | https://tenant.sharepoint.com/sites/<sitename> | SharePoint Online Management Shell cmdlet | -> Get-SPOSite |
| Log line signature | Event ID 30001 Operation 'DenyList' or 'SharePointFileOperation' | Office 365 audit log | |
Log Files to Check
C:\Temp\SharePoint_403_audit.csvC:\Temp\SharePoint_user_check.log
What This Error Actually Means
The HTTP 403 Access Denied error is raised by SharePoint Online when a user attempts to access or modify resources they are not authorized to use based on their assigned permissions and roles within the organization. The permission engine of SharePoint evaluates each request against the defined security policies, including group memberships, unique permissions, and external sharing settings. If the evaluation determines that the user lacks sufficient privileges for the requested action, an HTTP 403 error is returned with a message indicating "Access Denied. You don't have permission to perform this action or access this resource." This error can occur across various actions such as viewing site content, uploading files, editing list items, and more.
Affected Versions and Scope
This error affects all Microsoft 365 tenants using SharePoint Online for document management and collaboration. It is not specific to any particular version or build of the OS but rather depends on how permissions are configured within the tenant's environment. The issue can arise in both modern and classic SharePoint experiences, impacting users with varying roles such as site owners, members, visitors, and external contributors.
Where To Look First: Logs and Event IDs
To diagnose an HTTP 403 error, start by examining the Unified Audit Log for relevant events. Use PowerShell to export audit logs related to access attempts:
Search-UnifiedAuditLog -StartDate (Get-Date).AddDays(-7) -EndDate (Get-Date) -Operations FileAccessed,SiteAccessed | Where-Object {$_.AuditData -match 'Denied'} | Export-Csv C:\Temp\SharePoint_403_audit.csv
This command retrieves failed access attempts over the last week and exports them to a CSV file at
C:\Temp\SharePoint_403_audit.csv. Look for events with Event ID 30001, which indicates denied operations such as 'DenyList' or 'SharePointFileOperation'.
Additionally, check SharePoint logs in the Microsoft Purview compliance portal by searching for the Correlation ID displayed on the error page. Navigate to
Microsoft Purview compliance portal > Audit > Activity search, set Operation to 'SiteAccessed' or 'FileAccessed', and Result to 'Failure'. Paste the Correlation ID into the search field.
Root Causes
User Not Added to Site or Library Permissions
If a user is not explicitly added as a member, visitor, or owner of a site or library with unique permissions, they will receive an HTTP 403 error. Check the SharePoint admin center for group membership and ensure users are correctly assigned roles.
Unique Permissions on Libraries
Libraries can have unique permissions that override those inherited from the parent site. If a user was removed during this process but not re-added, they will face access issues. Review library settings to confirm inheritance or manually add missing users.
External Sharing Disabled for Guest Accounts
When external sharing is disabled and a guest account attempts to access resources, an HTTP 403 error occurs. Verify the site's external sharing capabilities via PowerShell:
$siteUrl = "https://tenant.sharepoint.com/sites/sitecollection"
Get-PnPSite -Includes SharingCapability | Where-Object {$_.SharingCapability -eq 'Disabled'}
This command checks if external sharing is disabled for a specific site.
Site Locked by Admin
Administrators can lock sites to prevent access temporarily using PowerShell:
Set-SPOSite -Identity https://tenant.sharepoint.com/sites/sitecollection -LockState NoAccess
Ensure the site is not locked when troubleshooting HTTP 403 errors.
Fix Procedure
- Check the Correlation ID on the error page and use it to search for relevant audit logs as described above.
- Navigate to SharePoint admin center > Active sites, select the affected site, then go to the Permissions tab. Confirm that the user is listed with appropriate roles.
- If unique permissions are in place on a library, ensure users have been re-added after breaking inheritance. Use PowerShell to manage these settings:
Set-PnPList -Identity "Documents" -BreakRoleInheritance -CopyRoleAssignments
This command breaks role inheritance for the 'Documents' library while copying existing assignments.
Be cautious when modifying permissions, as changes can affect multiple users and devices enrolled in the tenant.
- Unlock a site if it is locked by an admin using:
Set-SPOSite -Identity https://tenant.sharepoint.com/sites/sitecollection -LockState Unlock
- To add or modify user permissions via PowerShell, use commands like:
Add-PnPSiteUser -LoginName "[email protected]" -Role "Contributor"
This adds a new user with the Contributor role.
Error Code Variants
| HTTP Status Code |
Description |
Distinguishing Features |
401 Unauthorized |
User is not authenticated. |
No credentials provided or incorrect login details. |
503 Service Unavailable |
Service temporarily overloaded. |
Error occurs during high traffic periods, resolves once load decreases. |
Verification
After applying fixes, verify that the issue is resolved by attempting to access the restricted resource again. Confirm via PowerShell:
Get-PnPUnifiedAuditLog -ContentType SharePoint -StartTime (Get-Date).AddDays(-1) | Where-Object {$_.Operation -eq 'SiteAccessed'}
Look for entries with ResultStatus 'Succeeded', indicating successful access attempts.
Prevention
To prevent recurrence of HTTP 403 errors, implement regular audits of SharePoint permissions and ensure that changes to group memberships are promptly reflected in site settings. Use PowerShell scripts to automate the process of checking and updating user roles across multiple sites:
$users = Get-PnPSiteUser -Site https://tenant.sharepoint.com/sites/sitecollection
$users | ForEach-Object { Add-PnPSiteGroupMember -LoginName $_.LoginName }
This script retrieves all users from a site and adds them to the default group, ensuring consistent permission levels across the organization.
By following these steps, you can effectively diagnose and resolve HTTP 403 Access Denied errors in SharePoint Online while maintaining robust security practices within your Microsoft 365 environment.