Invoke-PnPSiteTemplate - "Access is Denied" error #4014
-
So I've outputted a .pnp file by using the following command. Get-PnPSiteTemplate -Out "c:\temp2\sp\PnP-Provisioning-FileV2.pnp" The file outputs correctly without errors as far as I can see. I then use the Invoke-PnPSiteTemplate to connect to my new site. I am then applying the template by using the following command: Invoke-PnPSiteTemplate -Path "c:\temp2\sp\PnP-Provisioning-FileV2.pnp" -ClearNavigation It seems to be doing something for a good 2 or 3 minutes, and then I am met with the following error every time: Invoke-PnPSiteTemplate: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)) If I go to the site, it seems to have applied the majority of the template, though I notice it hasn't applied the colour scheme, and the only image on the home page that should be there, is not actually there, it looks like a broken image. I'm not sure if these things would cause the access denied error, or if there is a more detailed log area I can view to try and determine what it doesn't like? Any help is much appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I have seen this sort of thing before on sites with Disable NoScript : Debug info might show the issue also: Then try invoking your template. |
Beta Was this translation helpful? Give feedback.
I have seen this sort of thing before on sites with
NoScript
enabled. You could try disabling that first then reapply the template.Disable NoScript :
Set-PnPTenantSite -Url '<New site url>' -DenyAddAndCustomizePages:$false
Debug info might show the issue also:
Set-PnPTraceLog -On -Level Debug
Then try invoking your template.