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."


1 Answer 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.

$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"



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.