0

I am using SharePoint Online Communication site and while i am trying to upload custom page templates i could not upload them and the migration tool says "Failure to upload document: Access denied."

0

1 Answer 1

1

The issue occureses when the customization are made to a "Group team site" or a "Communication site" witch are "Modern sites".

In that case a additionnal step is requared, witch is "enable customize scripts using PowerShell".

Here's PowerShell for you.

#Parameters
$TenantAdminURL= "https://tenant-admin.sharepoint.com"
$SiteURL= "your site collection URL"

#Connect to Tenant Admin
Connect-PnPOnline $TenantAdminURL -UseWebLogin

#Get the Tenant Site Object
$Site = Get-PnPTenantSite -Url $SiteURL

#Enable Custom Scripting by turning OFF Deny Flag
$Site.DenyAddAndCustomizePages = "Disabled"
$Site.Update()
$Site.Context.ExecuteQuery()

Reference:

https://www.sharepointdiary.com/2017/12/how-to-enable-custom-script-in-sharepoint-online.html#ixzz6Y0ZOWt61

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.