Enable Scripting

2 Feb 2016 One-minute read Al Eardley
Office 365PowerShell

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:

  1. Use the UI
  2. Use PowerShell

Using the UI

  1. Open the SharePoint Admin centre in the Office 365 tenant
  2. Select Settings
  3. Under Custom Script select the “Allow …” checkboxes, as shown below

Image lost in migrations!

  1. 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: