Skip to main content

How to enable custom scripts in SharePoint 2019 (using PowerShell)

BindTuning Team avatar
Written by BindTuning Team
Updated over 2 months ago

When installing BindTuning solutions on your SharePoint 2019 On-Premises environment, certain features that provide extended functionalities may require custom scripting to be enabled. By default or due to specific farm policies, custom scripting might be disabled, leading to some common issues.


Why is custom scripting required?

If custom scripting is not activated on your SharePoint 2019 site, you may encounter the following issues related to BindTuning products

These are some common issues related to BindTuning products when custom scripting is disabled:

  • Inability to install Classic themes
    You might find that the Solutions Gallery is unavailable under Site Settings, preventing you from installing Classic themes.
    ​

  • Full-Color Experience Issues
    When applying the Full-Color Experience with your BindTuning modern theme, SharePoint may be unable to upload the necessary SpColor file, which contains styles for elements of the Modern experience, if custom scripting is disabled.


Steps to enable custom script

Prerequisites

To enable custom scripting on your SharePoint 2019 site collection, you need:

  • Access to your SharePoint 2019 server.

  • The ability to open SharePoint 2019 Management Shell as an administrator.

To enable custom scripting for a specific SharePoint 2019 site collection:

  1. Log in to your SharePoint 2019 Farm server.

  2. Open SharePoint 2019 Management Shell as an administrator.
    ​

  3. Execute the following PowerShell command:
    ​(Get-SPSite -Identity "https://Server/sites/SiteURL").DenyPermissionsMask= [Microsoft.SharePoint.SPBasePermissions]::EmptyMask
    ​

  4. The solutions gallery will be visible on your Site Settings.

This command modifies the DenyPermissionsMask property of the specified site collection, effectively enabling custom scripting by removing any restrictions.


For a comparison on how custom script is managed in the cloud environment, please refer to our article: How to enable custom scripts in SharePoint Online (using PowerShell)

Did this answer your question?