Forum Discussion
How do I set DenyAddAndCustomizePages for SharePoint 2019 communication site
I ran into this issue during a migration to SP 2019, some features are not available until this is reset. See this posted solution:
From <http://blog.konffaaja.com/2018/11/sharepoint-2019-and-2019-denyaddandcustomizepages/>
$site = Get-SPSite -Identity "https://intranet.contoso.com"
$site.DenyPermissionsMask = [Microsoft.SharePoint.SPBasePermissions]::EmptyMask
This worked
The following Software are is used to connect to your SharePoint Online via Powershell:
Download and Install SharePoint Online Management Shell
https://www.microsoft.com/en-us/download/details.aspx?id=35588
While installation, and if you get an error "This application requires the following to be installed: - PowerShell 3.0"
Step 2: Open SharePoint Online Management Shell from your window search bar.
Step 3: Connect to your SharePoint Admin Portal
Type the following command to open connection:
Connect-SPOService
Enter the Url for your SharePoint Admin Portal (not your site, not yet):
Url: https://your-domain-admin.sharepoint.com/your-domain-admin.sharepoint.com
Replace with your domain
Hit Enter
Sign in
It will ask you for username and password for the user who has permission to manage SharePoint from SharePoint Admin Center
Step 4: Enable Scripting Capabilities on your site.
Type the following command that will enable scripting capabilities on your modern site and any other site:
Set-SPOsite https://your-domain.sharepoint.com/sites/modern-siteyour-domain.sharepoint.com/sites/modern-site -DenyAddAndCustomizePages 0
Replace with your domain
Replace with the path of your modern site