DeployToSubsite

%3CLINGO-SUB%20id%3D%22lingo-sub-2412343%22%20slang%3D%22en-US%22%3EDeployToSubsite%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2412343%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%3EGood%20morning%2C%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EI%20am%20trying%20to%20deploy%20a%20main%20site%20template%20to%20a%20sub%20site%20but%20I%20get%20the%20following%20error%3A%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3EInvoke-PnPSiteTemplate%3A%20Scope%20of%20template%20does%20not%20match%20target%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%3Ewould%20there%20be%20a%20way%20to%20deploy%20maybe%20with%20another%20command%3F%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2416081%22%20slang%3D%22en-US%22%3ERe%3A%20DeployToSubsite%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2416081%22%20slang%3D%22en-US%22%3EHi%20Alex%2C%20%3CBR%20%2F%3Ewhat%20kind%20of%20object%20are%20you%20trying%20to%20deploy%3F%20If%20the%20scope%20is%20not%20correct%20maybe%20that%20you%20are%20deploying%20a%20Site%20template%20in%20a%20subsite.%20%3CBR%20%2F%3EIn%20the%20XML%20you%20should%20see%20something%20like%3A%3CBR%20%2F%3E%3CPROVISIONINGTEMPLATE%20id%3D%22%26quot%3BTEMPLATE-8F4D883BE25B442FB9F889C351D3EA0B%26quot%3B%22%20version%3D%22%26quot%3B1%26quot%3B%22%20basesitetemplate%3D%22%26quot%3BSITEPAGEPUBLISHING%230%26quot%3B%22%20scope%3D%22%26quot%3BRootSite%26quot%3B%22%3E%3CBR%20%2F%3EIf%20the%20scope%20is%20RootSite%20you%20can%20not%20deploy%20it%20as%20a%20subsite.%3CBR%20%2F%3E%3CBR%20%2F%3EHope%20this%20helps%3C%2FPROVISIONINGTEMPLATE%3E%3C%2FLINGO-BODY%3E
New Contributor

Good morning,

I am trying to deploy a main site template to a sub site but I get the following error:

Invoke-PnPSiteTemplate: Scope of template does not match target

would there be a way to deploy maybe with another command?

3 Replies
Hi Alex,
what kind of object are you trying to deploy? If the scope is not correct maybe that you are deploying a Site template in a subsite.
In the XML you should see something like:
<pnp:ProvisioningTemplate ID="TEMPLATE-8F4D883BE25B442FB9F889C351D3EA0B" Version="1" BaseSiteTemplate="SITEPAGEPUBLISHING#0" Scope="RootSite">
If the scope is RootSite you can not deploy it as a subsite.

Hope this helps

@andrea_rucci 

Thanks a lot, it was helpful.
Unfortunately now I find a different error while I deploy: Invoke-PnPSiteTemplate: Duplicate field name found
is there no way to make it ignore the duplicate elements?
Hi Alex,
you can have no duplicate internal name fields in SP.
You could modify the internal name mantaining the same display name.
Is the errore regarding a custom or native column?