Skip to content

Sites Allowing Custom Scripts

The question it answers: Which SharePoint sites allow custom script, so any owner or designer can add JavaScript that runs for every visitor?

On a site where custom script is allowed, any owner or designer can add JavaScript that runs in every visitor’s browser session - with their permissions. Microsoft now switches custom script off again 24 hours after it is enabled, so a site listed here was either changed in the last day or the tenant delays that enforcement.

Where in the appSharePoint Online › Sharing & Governance › Sites Allowing Custom Scripts
WorkloadSharePoint Online
KindTable
DataRead from Microsoft 365 when someone first opens it, then kept for the report cache lifetime (Settings > Data & cache, 1 hour unless changed). It reads through PowerShell (Exchange Online or SharePoint Online), so the first load takes longer than a Graph report.
LicenceSharePoint Online.
Report id (API and MCP)sharepoint.governance.custom-script-sites
ColumnKeyType
SiteTitleLink
URLUrlText
TypeKindStatus
TemplateTemplateText
OwnerOwnerText
Last content changeLastContentModifiedDate
Storage (GB)StorageUsedGbText

Licence: SharePoint Online.

Application permissions on the IntensiveReports app registration (all permissions):

PermissionAPIWhat it allowsNote
Sites.FullControl.AllOffice 365 SharePoint OnlineHave full control of all site collectionsapplication, certificate
Data sources it reads
  • Get-PnPTenantSite -Detailed (DenyAddAndCustomizePages)
GET /ir-api/v1/reports/sharepoint.governance.custom-script-sites?size=100

An AI assistant reads it with the MCP tool get_report and the id sharepoint.governance.custom-script-sites. The client needs the Read grant for SharePoint Online. See Using the API.