So here are the steps for resolving the issue.
Step 01: Go to Admin panel
Step 02: Go to SharePoint admin center by selecting SharePoint from the left navigation
Step 03: There go to the setting page
Step 04: From there allow Custom Script
There is a note saying “changes to this setting might take up to 24 hours to take effect.” So here is the power shell command to do that for immediate effect.
Step 01: Open the SharePoint Management shell
Step 02: Type the below command to connect with SharePoint Admin Center in management shell. You have to replace your admin center url which is in line 1.
- $spadminurl = “https://suhailj-admin.sharepoint.com/”
- connect-sposervice -url $spadminurl
Step 03: You will be asked to enter user name and password.
Step 04: Enter the below commands. You have to mention your site collection url where you need the sections.
- $spsiteurl = “https://suhailj.sharepoint.com”
- Set-SPOsite $spsiteurl -DenyAddAndCustomizePages 0
Technical Solutions Professional | Modern Workplace Architect Lead | Microsoft 365 | SharePoint | Power Platform | MS Teams | React
Leave a Reply