How can we help you today?

Prerequisite 2: Enable Scripting Capabilities with PowerShell (SharePoint 2019)



In order to install ShortPoint SPFx for both modern and classic SharePoint pages, you must first enable Scripting Capabilities with PowerShell. By default, scripting capabilities are not enabled with classic sites. The only way to enable scripting capabilities on modern sites is using PowerShell. 


NOTEStarting November 2024, Microsoft will make it very hard to keep Scripting Capabilities enabled on SharePoint Sites. 

They are currently automatically disabling Scripting Capabilities every 24 hours unless you run the command outlined here under Persist custom script settings.

However, starting November 2024, this command will no longer work, which means that you will need to manually run a script daily to enable scripting capabilities. 

We highly recommend migrating your SharePoint Environment from Classic Sites and Pages to Modern Sites and Pages. 

You may reach out to our support team for recommendations on how to do this. You can contact us by sending an email to support@shortpoint.com or by submitting a ticket. 

We also recommend migrating off of SharePoint add-ins that require Scripting Capabilities to function. Note that ShortPoint doesn't require Scripting Capabilities to run on Modern Sites and Pages.


NOTEStarting March 2024, Microsoft will remove the ability to enable scripting capabilities in the SharePoint admin center. 

Custom Script in Admin Center

Users can still enable this option through PowerShell but migrating off Classsic Pages and Sites is highly recommended. Please read the note above.

Short walkthrough for advanced users:

  1. Login to your SharePoint 2019 Farm Server.
  2. Open SharePoint 2019 Management Shell as administrator.
  3. Execute the following PowerShell command:


(Get-SPSite -Identity "https://your-host/sites/modern-site").DenyPermissionsMask = [Microsoft.SharePoint.SPBasePermissions]::EmptyMask


Replace your-host with your hostname. 

Replace modern-site with the path of your modern site. 


For example: 

(Get-SPSite-Identity"https://shortpoint2019/sites/portal").DenyPermissionsMask=[Microsoft.SharePoint.SPBasePermissions]::EmptyMask


4.  Persist custom script settings by running the command below in PowerShell:


Set-SPOTenant -DelayDenyAddAndCustomizePagesEnforcement $True


Once done, you can proceed to enable IIS 6 Metabase Compatibility. 


TABLE OF CONTENTS


This article is for you if

  • You are running the ShortPoint SPFx package on SharePoint 2019 Farm Server.
  • You have faced this issue while running ShortPoint Installation.
  • You want to enable scripting capabilities on modern sites (only required if you're going to use ShortPoint on classic pages)
  • You want to enable scripting capabilities on group sites (only required if you're going to use ShortPoint on classic pages)
  • You want to enable scripting capabilities on a specific SharePoint 2019 On-Premise site only.
  • You have Farm Server Administrator access.


How to enable Scripting Capabilities with PowerShell 


Follow the steps below to enable Scripting Capabilities with PowerShell. 


Step 1: Open SharePoint 2019 Management Shell


First, use the Windows search box to look for SharePoint 2019 Management Shell. Right-click on the app and select Run as administrator


Run as administrator button


A pop-up window will appear asking you if you want to allow the app to make changes to your device. Click Yes.


Yes button


You will be redirected to Administrator: SharePoint 2019 Management Shell.


Administrator: SharePoint2019 Management Shell


Step 2: Enable Scripting Capabilities on your site


Type the command below to enable scripting capabilities:


(Get-SPSite -Identity "https://your-host/sites/modern-site").DenyPermissionsMask = [Microsoft.SharePoint.SPBasePermissions]::EmptyMask


Replace your-host with your hostname. 

Replace modern-site with the path of your modern site. 


For example: 

(Get-SPSite-Identity"https://shortpoint2019/sites/portal").DenyPermissionsMask=[Microsoft.SharePoint.SPBasePermissions]::EmptyMask


After typing this command, hit Enter using your keyboard. 


SharePoint 2019 Management Shell command


Step 3: Persist custom script settings

To prevent SharePoint from resetting custom script settings to its original value, run the following command in PowerShell:


Set-SPOTenant -DelayDenyAddAndCustomizePagesEnforcement $True


NOTEStarting November 2024, this command will stop working as outlined in the Pesist custom script section.For this reason, we highly recommend moving your pages from Classic Sites and Pages to Modern Sites and pages to avoid disruption. We also recommend to stop relying on add-ins that require scripting capabilities to be enabled to run. ShortPoint does not need Scripting Capabilities to run on Modern Sites and Pages.


That’s it! You now have scripting capabilities enabled. Go ahead and continue to do Prerequisite 3: Enable IIS 6 Metabase Compatibility (SharePoint 2019)


Related Articles:



Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.

World's best intranet sites are designed using ShortPoint

Get started today! Learn more
See all 12 topics

Start a trial

Ignite your vision. Install ShortPoint directly on your site, or play in sandbox mode. No credit card required.

Get started today

World’s best intranet sites are designed using ShortPoint

Thousands of companies using ShortPoint everyday to design, brand and build award winning intranet sites.

Get started Learn more