Forum Discussion
Invoke-PnPSiteTemplate Exception from HRESULT: 0x8107140F
Hi i get this error when i try to invoke PnP site template: Invoke-PnPSiteTemplate : Exception from HRESULT: 0x8107140F.
Code here
# eskport
$SiteURL = "SP Page link"
Connect-PnPOnline -Url $SiteURL -Interactive
Set-PnPSite -Identity $SiteURL -NoScriptSite $false
Invoke-PnPSiteTemplate -Path C:\Users\Kamil\Desktop\skrypty\xd3\OutputTemplate.xml
I create a template with this code
# impoort strony jako template
$SiteURL = "SP Page link"
Set-PnPSite -Identity $SiteURL -NoScriptSite $false
Connect-PnPOnline -Url $SiteURL -Interactive
Get-PnPSiteTemplate -Out C:\Users\Kamil\Desktop\skrypty\xd3\OutputTemplate.xml -PersistBrandingFiles -IncludeSiteGroups -IncludeHiddenLists
Please help.
- LeonPavesicSilver Contributor
Hi buszi99,
The error message you received, "Exception from HRESULT: 0x8107140F," indicates that there was an issue while invoking the PnP site template. This error code typically suggests that the site template you are trying to apply contains components that are not allowed or supported on the target site.
To troubleshoot this issue, you can try the following steps:
Ensure that you have the latest version of the PnP PowerShell module installed. You can update the module by running the following command:
Update-Module -Name SharePointPnPPowerShellOnlineVerify that the template file you are using (OutputTemplate.xml) is valid and does not have any issues. You can open the XML file and inspect its contents to ensure it is well-formed and complete.
Check the compatibility of the template with the target site. Certain features or components in the template might not be supported on the target site, causing the error. Make sure the target site has the necessary features and configurations to support the template you are applying.
If you suspect that a specific component in the template is causing the issue, you can try excluding it during the template export or removing it from the XML file before invoking the template. This way, you can identify which component is causing the error and troubleshoot accordingly.
Ensure that you have the necessary permissions and administrative rights to apply the site template. Depending on the features and settings involved, you may require appropriate permissions to execute the template successfully.
Kindest regards