Applies To: SharePoint Online
Description
Crow Canyon NITRO Studio requires that custom scripting should be enabled in the SharePoint site.
Please refer this Microsoft article to enable scripting from the SharePoint admin center. It takes about 24 hours for this change to take effect for the sites. To enable scripting immediately for the site using PowerShell, please follow the detailed steps given below. Note that enabling the scripting from SharePoint admin center is still required as otherwise it overrides the settings done using PowerShell (in about 24 hours).
Steps to enable scripting using PowerShell
- Download and Install Windows Management Framework 5.1 (if the Operating System is not Windows 10)
- Download and Install SharePoint Online Management Shell
- Open SharePoint Online Management Shell from Windows Start Menu
- Connect to your SharePoint Admin Portal
- Enter the following command to open connection:
- Connect-SPOService
- Enter the URL of your SharePoint Online admin portal:
- https://<your_tenant_name>-admin.sharepoint.com
- For example, if your SharePoint tenant domain is https://mycompany.sharepoint.com, enter https://mycompany-admin.sharepoint.com
- Enter the following command to open connection:
- Sign in
- Enter the username and password for the user who has tenant admin permissions5. Enable Scripting Capabilities on your site
Step 1: Update site collection property to enable scripting
- Enter the following command to enable scripting capabilities on your site:
Set-SPOsite <Site Collection URL> -DenyAddAndCustomizePages 0
- We need to enter the site collection URL for <Site Collection URL>
- E.g. Site Collection URL: https://your-tenant-name.sharepoint.com/sites/site1
Step 2: Persist custom script settings
- Step 1 above will enable scripting capabilities for the site only for 24 hours and SharePoint resets it to blocked state.
- To avoid SharePoint resetting custom script settings, below command need to be run in SharePoint Online Management Shell
-
Set-SPOTenant -DelayDenyAddAndCustomizePagesEnforcement $True
-