I try to create a template for Teams with a specific folder structure, e.g.

General -Folder 1 -Folder11 -Folder12 -Folder 2

I managed to create a Team with PNP so far, but I'm struggeling to connect it to the right SharePoint site. I get the following error message:

WARNUNG: Teamifying site at URL - https://{tenantname}/sites/testmatthias3 failed due to 
an exception:- Exception while invoking endpoint
 WARNUNG: Teamifying prompt couldn't be hidden at site at URL - 
 https://{tenantname}.com/sites/testmatthias3 in App-only context 

This is my PowerShell code so far:

$Clientid= "989abaac-bf99-49ae-9dbd-dc83e9b14a1e"
$thumbprint ="B971C3CA8D6455D51238336EFAD50F5F151CFFD2"
Install-Module pnp.Powershell

# Connect to the target tenant with app-only context
 Connect-PnPOnline {tenantname}.sharepoint.com/ -ClientId $clientId `
   -Thumbprint $thumbprint -Tenant $tenant

#Apply the tenant template
Invoke-PnPTenantTemplate -Path 

I can't find the error.

I hope you can help

  • As a workaround - maybe just create folders with "Add-PnPFolder" Apr 26 at 0:35


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.