SharePoint Online: Access Denied Error on Navigation Settings

Problem: When trying to change the navigation settings of a SharePoint Online site, I got an access denied error. Access Required: Sorry, you don’t have access.

sharepoint online navigation settings access denied

I’m sure, I am a Global Admin in Office 365 and Site Collection Administrator for that particular site collection. I tried the PowerShell way and got a similar error: “Access denied. You do not have permission to perform this action or access this resource.

The solution to the Navigation Settings Access Denied Error:

To fix this issue: You have to set the “Custom Script” setting to “Allow users to run custom script on self-service created sites” in the SharePoint Online Admin Center Settings page, and it takes 24 hours or so to propagate! So, let’s not wait and enable custom script at the site collection level.

PowerShell to Enable Custom Scripts in SharePoint Online Site Collection:

Enable the Custom scripts in the SharePoint Online site to resolve the error!

#Config Parameters
$AdminSiteURL="https://crescent-admin.sharepoint.com"
$SiteURL="https://crescent.sharepoint.com/sites/marketing"
   
#Get Credentials to connect
$Cred = Get-Credential
   
#Connect to SharePoint Online Tenant Admin
Connect-SPOService -URL $AdminSiteURL -Credential $Cred
   
#Disable DenyAddAndCustomizePages Flag
Set-SPOSite $SiteURL -DenyAddAndCustomizePages $False

Here is another post on enabling custom script in SharePoint Online: How to Enable Custom Script in SharePoint Online?

Salaudeen Rajack

Salaudeen Rajack - Information Technology Expert with Two-decades of hands-on experience, specializing in SharePoint, PowerShell, Microsoft 365, and related products. He has held various positions including SharePoint Architect, Administrator, Developer and consultant, has helped many organizations to implement and optimize SharePoint solutions. Known for his deep technical expertise, He's passionate about sharing the knowledge and insights to help others, through the real-world articles!

Leave a Reply

Your email address will not be published. Required fields are marked *