Elevate App’s privileges does not work in SharePoint Online

This article explains how to enable custom scripts for any SharePoint Online Site. There are quite a few articles on the Internet that explains how to enable custom script, so why am I writing this blog❓

Because there was a “Confusion” and a “Problem“.


The Confusion:

On SharePoint Online Tenant we had custom script enabled, you can check this by Navigating to SharePoint Admin Centre(https://yoursharepointdomain-admin.sharepoint.com) ->Settings -> Custom Script-> The radio buttons should be set to ‘Allow Users to run custom script’.

Custom Script.jpg


The Problem:

One of the power-user added an App to this site-collection, which needed elevated privileges. The developer tried to elevate the App’s privileges numerous times but was not successful. He was banging this head against the wall. 😡


Troubleshooting:

Navigate to site-settings for the newly created site-collection and compare the site-settings page with previous another site-collection. You will see that some of the features are missing e.g. Solution Gallery, Save Site as a template etc.

Sitesetting.jpg

It should give you a hint (💡) that you need to enable Custom Script.


So how was this site-collection created? Any guesses?

The site-collection was created by -> clicking on the Office app launcher -> click SharePoint -> click Create Site Select Team Site from the option -> Enter the Site Name & Site description. It was a Modern SharePoint Online Team site.


Resolution:

  • Install the SharePoint Online Management Shell by downloading and running the SharePoint Online Management Shell.
  • Run SharePoint Online Management Shell with Elevated Privileges(Run as Administrator).
    • Admin.jpg
  • Execute PowerShell commands against SharePoint online.

Connect-SPOService -URL https://yoursharepointdomain-admin.sharepoint.com

Set-SPOsite https://yoursharepointdomain.sharepoint.com/sites/sitecollection -DenyAddAndCustomizePages 0

SPOPS.jpg

All done.🙂 Now you should be able to elevate the Apps privileges and access advanced features.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s