In Office 365, it is desirable to be able to configure the look and feel, and behaviour of pages through the use of JavaScript, HTML or even PowerShell. The ability to do this is disabled by default when a new Office 365 tenant is created.
Most of the time, this feature is then activated as the features are required. What is less understood is the scope of impact of this setting.
The full list of features that are impacted can be found here
To enable scripting, as with most of Office 365, there are two approaches:
- Use the UI
- Use PowerShell
Using the UI
- Open the SharePoint Admin centre in the Office 365 tenant
- Select Settings
- Under Custom Script select the “Allow …” checkboxes, as shown below
Image lost in migrations!
- Select OK
This process can take up to 24 hours
Using PowerShell
In the following PowerShell script replace “” with the name of the Office 365 tenant.
$AdminSiteUrl = "https://<<TenantName>>-admin.sharepoint.com";
$RootSiteUrl = "https://<<TenantName>>.sharepoint.com";
#Using Windows Credential Maanger to store the credentials
Connect-SPOnline -Url $AdminSiteUrl
## Enable scripting
Set-SPOSite -Identity $RootSiteUrl -DenyAddAndCustomizePages $false;
This process will be instant.
Table of Contents
Comment on this post: