Digital Expedient

Sharing my experience as working with SharePoint

Digital Expedient

Sharing my experience as working with SharePoint

Remove custom scripting in OneDrive & SharePoint

Microsoft Update (March 2024) – MC714186

About custom script feature

Custom script feature enables your site owners to change the look & feel of SharePoint sites by applying custom styles (using CSS and HTML), change client side functionality by using JavaScript code etc. and much more. This feature can only be allowed by SharePoint administrators or Global Administrators of your tenant and can be enable or disabled using below PowerShell commands.

To allow custom script on SharePoint sites:

Set-SPOSite <yoursiteurl> -DenyAddAndCustomizePages 0

To prevent custom script on SharePoint sites:

Set-SPOSite <yoursiteurl> -DenyAddAndCustomizePages 1

In addition to this, you can allow or prevent the custom script setting using classic settings page (see below)

https://<yourtenantname>-admin.sharepoint.com/_layouts/15/online/TenantSettings.aspx

For additional information please visit: allow or prevent custom script

Latest update

Custom script setting will be removed from SharePoint admin center in March 2024. This means site owners will no longer be able to add, modify or remove the scripts from SharePoint & OneDrive without impacting the execute ability of the existing scripts.

Things to prepare before this change

To delay this change, you may use below new PowerShell command until November 2024. It is available with SharePoint Online Management Shell version 16.0.24524.12000.

Set-SPOTenant DelayDenyAddAndCustomizePagesEnforcement $True

Also, you can inform your site owners about this update and do needful to update the training documents as needed.