If you are trying to install ShortPoint on your SharePoint site, and you came across an error message saying that you have to enable scripting capabilities to finish the installation, then this article is for you.
Scripting capabilities are not enabled with modern sites (and other sites) by default, and cannot be enabled using the admin portal for modern sites. You cannot install ShortPoint Add-In on modern sites if scripting capabilities are not enabled. The only way to enable scripting capabilities is through 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 removed the ability to enable scripting capabilities in the SharePoint admin center.
Users can still enable this option through PowerShell but migrating off Classic Pages and Sites is highly recommended (Please read the note above).
TABLE OF CONTENTS
- Before we begin
- Prerequisites
- How to enable scripting capabilities with PowerShell
- Programmatically enable scripting capabilities on every active site in your tenant
- Scripting Capabilities Disabled After 24 Hours
- Disabling scripting capabilities on your site
Before we begin
- Make sure that you are a ShortPoint Designer with an active license.
- Make sure you have Microsoft 365 SharePoint environment.
- Make sure you already have experience with using PowerShell.
- This article is for you if you are seeing the message The installation has failed, please try again or Oops, the installation has failed! Scripting capabilities are not enabled on this site.
- This article is for you if you are enabling scripting capabilities on modern sites, group sites, or on a specific site only (Only required if you want to use ShortPoint on classic pages).
Prerequisites
- You need to have access to your SharePoint Admin Portal with the URL: https://your-domain-admin.sharepoint.com.
- You already have downloaded and installed SharePoint Online Management Shell.
- If you encounter the message: This application requires the following to be installed: PowerShell 3.0, you may need to download and install Windows Management Framework 5.0.
How to enable scripting capabilities with PowerShell
Follow the steps below to enable scripting capabilities on your Microsoft 365 SharePoint site:
Step 1: Open SharePoint Online Management Shell
From your computer, open SharePoint Online Management Shell.
Note: If you do not have the SharePoint Online Management Shell application on your computer, kindly go back to the prerequisite guidelines to learn how to download and install it.
Step 2: Connect and sign in to your SharePoint Admin Portal
On SharePoint Online Manage Shell, type the following command to open connection:
Connect-SPOService
Then, hit the Enter key.
Enter the URL of your SharePoint Admin Portal. Typically, the URL looks like this:
https:// your-domain -admin.sharepoint.com
Replace your-domain with the name of your site domain and hit Enter.
If you are successful in connecting to your site, it will ask you for a username and password. Sign in using the account of the user who has permission to manage SharePoint from the SharePoint Admin Center.
Step 3: Enable scripting capabilities on your a specific site
Type the following command to enable scripting capabilities on a specific site collection:
Set-SPOsite https:// your-domain .sharepoint.com/sites/modern-site -DenyAddAndCustomizePages 0
Replace
- your-domain with the name of your site domain.
- sites/modern-site with the path of your modern site.
To save time, you can run the same command automatically on all of the active sites in your tenant by following the instructions in the next section: "Programmatically enable scripting capabilities on every active site in your tenant"
Then, hit the Enter key.
Step 4: 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 Persist 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 have now enabled scripting capabilities in Microsoft 365. You will now be able to install ShortPoint on Modern or Classic Sites.
Programmatically enable scripting capabilities on every active site in your tenant
In case you have a lot of sites that you want to enable scripting capabilities on and don't want to write each site's name then you can do the following:
In the same SharePoint Online Management Shell, after logging in like outlined above, run the following command to generate a list of all of the active sites in your tenant:
Get-SPOSite -Limit ALL | Select Url | Export-Csv C:/temp/all-active-sites.csv -NoTypeInformation
This command will generate a csv list of all of the sites that are there in your tenant and place it in C:/temp/ (you can delete this later)
Then you can run the following lines to enable scripting capabilities on each site that's listed in the CSV file (copy and paste all of this text into the SharePoint Online Management Shell window then hit enter):
$siteUrls = Import-Csv -Path "C:/temp/all-active-sites.csv"; Set-SPOTenant -DelayDenyAddAndCustomizePagesEnforcement $True; foreach ($site in $siteUrls) { Write-Host "Running command on site: " $site.Url; Set-SPOSite -Identity $site.Url -DenyAddAndCustomizePages 0; };
To Stop Scripting Capabilities Being Disabled After 24 Hours
If you encounter an issue where the ShortPoint Web Part and the ShortPoint Dashboard is not loading because Scripting Capabilities was forcefully disabled by SharePoint after 24 hours, then follow the steps below:
First make sure you did the steps shown above (How to enable scripting capabilities with PowerShell) and make sure to repeat the 4th step (Step 4: Persist custom script settings).
Please read the notice about SharePoint deprecating the "Scripting Capabilities Persistence" command for MS 365 environments in November at the top of this article and keep in mind that we highly recommend transforming Classic Pages to Modern Pages to avoid these issues in the future (In addition to many other benefits).
Read more about this in this article: How to Transform a Classic SharePoint Page into Modern
Disabling scripting capabilities on your site
In the event that you want to disable scripting capabilities on your site, you may repeat the steps in this article. However, for Step 3, replace the command with:
Set-SPOsite https://your-domain.sharepoint.com/sites/modern-site -DenyAddAndCustomizePages 1
Replace
- your-domain with the name of your site domain.
- sites/modern-site with the path of your modern site.
Related articles:
- What Is "Scripting Capabilities" and Why Is It Required for Using ShortPoint on Classic Pages?
- ShortPoint Add-in: The installation has failed, please try again
- Oops, the installation has failed! Scripting capabilities are not enabled on this site
- How to Check License Expiration Date
- ShortPoint Add-in and SPFx Trial license