Invoke-PnPTenantTemplate did not perform any action and ends after 2 seconds only

john john Pter 405 Reputation points
2025-01-18T21:32:19.0766667+00:00

I have 2 tenants; Source & Destination. I export the site from source and try to invoke it inside the destination, but it failed, here are the steps i followed:-

  1. Connect-PnPOnline -Url "https://source.sharepoint.com/sites/Projects" -ClientId "b33*******a"

***Enter your credentials User: @.com Password for user @.com: ***********

  1. Get-PnPSiteTemplate -Out "PnP-Provisioning-File2.pnp" -IncludeSiteGroups -IncludeSearchConfiguration -Force

where i got this file:-

404569662-1f937010-6f9c-40d0-a85d-28950f9e11a1

  1. Connect-PnPOnline -Url "https://destination.sharepoint.com/sites/Porjects" -Interactive -ClientId f****7-d2*****
  2. Invoke-PnPTenantTemplate -Path "PnP-Provisioning-File2.pnp" -verbose

User's image

But last step "Invoke-PnPTenantTemplate", only took couple of seconds then it ends.. without invoking the template inside the destination,, any idea?

Thanks

SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
3,241 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Emily Du-MSFT 49,461 Reputation points Microsoft Vendor
    2025-01-20T02:08:22.6766667+00:00

    Please follow below tips to troubleshoot the issue.

    1.Ensure you are using the latest version of the PnP PowerShell module. Older versions might have bugs or missing features.

    Update-Module -Name PnP.PowerShell
    

    2.Make sure that the account you're using to connect to the destination site has the necessary permissions to apply the template. The account need to be a site collection administrator or have similar elevated permissions.

    3.Use following PowerShell to apply PnP Templates to SharePoint site.

    Connect-PnPOnline https://<tenant>.sharepoint.com/sites/<URL-of-your-target-site> -Interactive
    Invoke-PnPTenantTemplate -Path .\your-template-file.pnp -Parameters @{"SiteTitle"="<Title-of-your-target-site>";"SiteUrl"="/sites/<URL-of-your-target-site>"}
    

    Note: Replace <tenant> with the actual name of your SharePoint Online tenant in Microsoft 365. Remember to provide a value for all the parameters declared in the above table.

    4.Check errors in Verbose mode.

    Run the Invoke-PnPTenantTemplate command with the -Verbose flag to get more detailed output. This can help identify any specific errors.

    Invoke-PnPTenantTemplate -Path "Provisioning.pnp" -Verbose
    

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.