Problem: When trying to open a SharePoint Online site in SharePoint Designer, got this error message “You do not have permission to open this website in SharePoint Designer”
By default, SharePoint designer customization are disabled in modern group sites in SharePoint Online. To enable SharePoint designer, You have to set the “DenyAddAndCustomizePages” flag to False.
PnP PowerShell to Fix “You do not have permission to open this web site in SharePoint Designer”
#Parameters $TenantAdminURL = "https://crescent-admin.sharepoint.com" $SiteURL = "https://crescent.sharepoint.com/sites/Sales" #Connect to Tenant Admin Connect-PnPOnline $TenantAdminURL -UseWebLogin #Enable Custom Script for the Tenant Site Set-PnPTenantSite -Url $SiteURL -DenyAddAndCustomizePages:$false
This also enables custom scripting for the given SharePoint Online site.