Forum Discussion

Chad_V_Kealey's avatar
Chad_V_Kealey
Steel Contributor
Aug 13, 2018

Allow Custrom Scripting on a specific SP site

Some of our departments have made use of custom templates in SP doc libraries in our old 2010 environment and want to do the same in their Group-connected site in Office 365. However, trying to upload a template for a document content type throws an "Access Denied" message/dialog, even for a user who is a site collection admin.

 

In researching this, it appears that sites need to be set to allow "custom scripting" for this feature to work, although I'm not sure why (a .dotx file isn't a script, so far as I know). At any rate, this command, run in Powershell, should set the appropriate property on the site:

Set-SPOsite https://your-domain.sharepoint.com/sites/modern-site -DenyAddAndCustomizePages 0

 

However, when I try it on any sites in our tenant (standalone Site Collections or Group-connected sites), I get this error:

Set-SPOSite : The managed path sites/<siteURL> is not a managed path in this tenant.
At line:1 char:1
+ Set-SPOSite https://drexel0.sharepoint.com/sites/BusinessServicesSupp ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Set-SPOSite], ServerException
+ FullyQualifiedErrorId : Microsoft.SharePoint.Client.ServerException,Microsoft.Online.SharePoint.PowerShell.SetSite

 

I'm signed in as a SharePoint Admin, and even made sure the admin account is a site collection admin in the sites (which I don't think should matter, just covering the bases), so I'm not sure why this isn't working.

  • try Set-SPOSite -identity "site here in quotes" -DenyAddAndCustomizePages $false
    • Chad_V_Kealey's avatar
      Chad_V_Kealey
      Steel Contributor

      Deleted, no dice. Same message. Based on what it says, it seems like the change can only be made to site which are "managed paths" in the tenant, but I'm not sure exactly what that means or how to make a site a managed path. To me, it seems logical that sites created by a SharePoint admin (via the admin center or Powershell) would, by default be considered "managed", while Group-connected sites (created by end/non-admin users) may not.

      • Deleted's avatar
        Deleted
        Group connected and classic sites should all work the same that's odd your getting that message.

Resources