Custom Script Disable Functionality in SharePoint

Introduction 

 
If your Custom Script is Off, then you will lose some features which you generally use in SharePoint, i.e:
  • Save Site as Template will be disabled. The option to create a Template from a site will be invisible from Site Settings.
  • SharePoint Designer - Pages that are not HTML can no longer be updated. Handling List: Create Form and Custom Action will no longer work. Subsites: New Subsite and Delete Site redirect to the Site Settings page in the browser. Data Sources: Properties button is no longer available.
  • Save document library as the template will be disabled & you won’t find the option to save document library as template in Document Library Settings.
  • Solution Gallery will be invisible from Site Settings.
  • Theme Gallery will disappear from Site Settings.
  • Help Settings will be invisible from Site Settings.
  • HTML Field Security No longer available in Library Settings.
  • Solutions Gallery is no longer available in Site Settings.
  • Uploading files that potentially include script The following file types can can not be uploaded to a library:

    • .asmx
    • .ascx
    • .aspx
    • .htc
    • .jar
    • .master
    • .swf
    • .xap
    • .xsf
An admin can enable Custom Script on Tenant Level & Site Level.
 
To enable Custom Script on Tenant level follow these steps:
  1. From your SharePoint site, click on the waffle icon
  2. Click on Admin
  3. Expand Admin centers and click on SharePoint
  4. On the SharePoint Admin Center click on Settings
  5. Scroll down and locate the Custom Script
  6. Click on Allow users to run custom script on personal sites
  7. Click on Allow users to run custom script on self-service created sites
  8. Click OK
Note
Changes to the tenant settings can take up to 24 hours to be applied.
 
To enable Custom Script on Site level follow these steps
 
To enable custom scripts on modern sites, you will need to use SharePoint Online Cmdlets,
  1. Open the PowerShell console
  2. Execute the command

    Connect-SPOService -Url https://tenant-admin.sharepoint.com

  3. Execute the command below with the URL for the modern site collection:

    Set-SPOSite -Identity https://tenant.sharepoint.com/sites/contoso -DenyAddAndCustomizePages 0