Allow Custom Script On SharePoint Online

Recently, I observed if someone creates a Microsoft Teams site and opens it in SharePoint Online, they don’t get options like List Template under "Web Designer Galleries".

So, after doing some research, I found a solution which may help you in resolving the issue. 

To enable these options, we have to allow the users to run custom scripts on SharePoint Admin by following the below steps.

1. Open SharePoint Online Admin Centre.

2. Go to "Settings".

3. Make the following selection under the Custom Script section.

 
 
 

If we make this change via the SharePoint Admin Center, it will take 24 hours to activate. If you want to activate it immediately, you can follow these steps.

 

You can achieve it by using PowerShell.

  1. Open PowerShell Editor.
  2. Connect with the SPO Service using the following command.

    Connect-SPOService -Url "https://$($tenantName)-admin.sharepoint.com"

  3. Set the ‘DenyAddAndCustomizePages’ property to 0 (zero) by using this command.

    Set-SPOsite $SiteURL -DenyAddAndCustomizePages 0

After running the above command, you can check that the options are now active on the Site Settings page.