Skip to content
This repository was archived by the owner on Jan 19, 2021. It is now read-only.

cant generate site provisioning template on a specific tenantΒ #2810

@get-mrsmit

Description

@get-mrsmit

#2482 ## Environment
[X] Office 365 / SharePoint Online

Expected or Desired Behavior

With the SharePointPnPPowershellOnline module version 3.26.2010.0
Generate a site template with extension .XML

Steps to Reproduce

###built a connection to the sharepoint site where a template must be generated
$siteurl = "https://tenant.sharepoint.com/sites/templatesite"
Connect-PnPOnline -Url $siteurl -UseWebLogin

generate a provisioning template

$filename = "C:\temp" + "SiteTemplate.xml"
try{
Get-PnPProvisioningTemplate -Out $filename -ErrorAction Stop
}catch{
Write-Error $_
}

Extra information

So this issue occurs on one specific tenant,
i have for my self 1 devops tenant and at my company we have 3 extra test/demo tenants.
When i do the same thing with the same pnppowershell module no error eccurs.

The error that we getting is
Get-PnPProvisioningTemplate : The remote server returned an error: (403) Forbidden.
At line:1 char:1

  • Get-PnPProvisioningTemplate -Out $filename -ErrorAction Stop -ErrorVa ...
  •   + CategoryInfo          : WriteError: (:) [Get-PnPProvisioningTemplate], WebException
      + FullyQualifiedErrorId : EXCEPTION,PnP.PowerShell.Commands.Provisioning.Site.GetProvisioningTemplate
    

PS C:\GITREPO\QS_SVB> $thiserrormessage

The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: The remote server returned an error: (403) Forbidden.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions