Enable Custom Scripts in SharePoint Sites

Scripting can be enabled or disabled at the tenant level. It is recommended to leave it off. 

Scripting can be enabled for a specific site collection using PowerShell. 1

Set-SPOSite <SiteURL> -DenyAddAndCustomizePages 0

or, if using PnP.PowerShell:

Set-PnPSite -Identity <SiteURL> -NoScriptSite $false

If you change this setting for a classic team site, it will be overridden by the Custom Script setting in the admin center within 24 hours.

  1. Allow or prevent custom script - SharePoint in Microsoft 365 | Microsoft Learn↩︎

August 11, 2023
Buy me a Coffee
Support this site.