Allow custom scripts in SharePoint online site
Summary
This sample script shows how to allow use of custom scripts in SharePoint online at site level.
Scenario inspired from this blog post: Allow use of custom scripts in SharePoint Online using PowerShell
# SharePoint online admin center URL
$adminCenterUrl = "https://contoso-admin.sharepoint.com/"
# SharePoint online site URL
$siteUrl = Read-Host -Prompt "Enter your SharePoint site URL (e.g https://contoso.sharepoint.com/sites/SPConnect)"
# Connect to SharePoint online admin center
Connect-SPOService -Url $adminCenterUrl
# Allow custom scripts on SharePoint online site
Set-SPOSite $siteUrl -DenyAddAndCustomizePages 0
# Disconnect SharePoint online connection
Disconnect-SPOService
Check out the SPO Management Shell to learn more at: Introduction SharePoint Online Management Shell | Microsoft Docs
Contributors
Author(s) |
---|
Ganesh Sanap |
Disclaimer
THESE SAMPLES ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.