In this post, we are going to review how to enable custom scripting on site collection level and what will be its impact.
So if we enable scripting at tenant level we may end up loosing control over security. Instead Microsoft Provided a way to enable scripting at site collection level.
- SharePoint Online Management Shell
Follow below steps to enable scripting at site collection level:
- Open the SharePoint Online Management Shell console.
- Execute the command to connect the Office 365 :
Connect-SPOService -Url https://tenant-admin.sharepoint.com
- Execute the command bellow with the url for the site collection where you want to enable scripting:
Set-SPOSite -Identity https://tenant.sharepoint.com/sites/contoso -DenyAddAndCustomizePages 0
- Tenant level scripting enable may take up to 24 hours. But this approach disable the scripting block immediately.
- As this settings are enabled at specific site collection, you can make sure the scripting do not affect other site collections or tenant.
We have seen limitations and how to overcome that. If you need to enable scripting, choose the settings as per your need.