Get-PnPProvisioningTemplate throws Access Denied error

%3CLINGO-SUB%20id%3D%22lingo-sub-999541%22%20slang%3D%22en-US%22%3EGet-PnPProvisioningTemplate%20throws%20Access%20Denied%20error%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-999541%22%20slang%3D%22en-US%22%3E%3CP%3EI%20am%20running%20below%20command%20in%20SharePoint%20Online%20Management%20Shell%20as%20administrator%20to%20get%20PnP%20Provisioning%20Template%20from%20a%20site%20collection%20in%20SharePoint%20online.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSTRONG%3EGet-PnPProvisioningTemplate%20-out%20Lists.xml%20-Handlers%20Lists%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIt%20throws%20following%20error%20in%20PowerShell%26nbsp%3B%20window%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%22Access%20denied.You%20do%20not%20have%20permission%20to%3CBR%20%2F%3Eperform%20this%20action%20or%20access%20this%20resource.%22%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20checked%20following%20things%3A%3C%2FP%3E%3CP%3E1.%20User%20I%20am%20running%20with%20PowerShell%20is%20a%20site%20collection%20administrator.%3C%2FP%3E%3CP%3E2.%20Permission%20is%20not%20broken%20for%20any%20lists.%3C%2FP%3E%3CP%3E3.%20Above%20command%20runs%20with%20handlers%20fields%20and%20contenttypes.%3C%2FP%3E%3CP%3E4.%20No%20list%20has%20any%20item%2Fdocument%2Fpage%20checked%20out.%20All%20data%20is%20checked%20in%20with%20major%20version%20published.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-left%22%20style%3D%22width%3A%20970px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F156117iB4DB2DBC7C7E836D%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22GetPnpProvisioningTemplateAccessDeniedError.png%22%20title%3D%22GetPnpProvisioningTemplateAccessDeniedError.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-999541%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EPnP%20Provisioning%20Template%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%20Online%20PnP%20PowerShell%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1015766%22%20slang%3D%22en-US%22%3ERe%3A%20Get-PnPProvisioningTemplate%20throws%20Access%20Denied%20error%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1015766%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F454165%22%20target%3D%22_blank%22%3E%40Ross_Packwood%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3Eit%20could%20be%20a%20Term%20Store%20Administration%20permission%20issue.%3C%2FP%3E%3CP%3ECould%20you%20check%20if%20your%20User%20is%20a%20Term%20Store%20Admin%3F%3C%2FP%3E%3CP%3ECheers%2C%3C%2FP%3E%3CP%3EFederico%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Occasional Visitor

I am running below command in SharePoint Online Management Shell as administrator to get PnP Provisioning Template from a site collection in SharePoint online.

 

Get-PnPProvisioningTemplate -out Lists.xml -Handlers Lists

 

It throws following error in PowerShell  window:

 

"Access denied.You do not have permission to
perform this action or access this resource."

 

I have checked following things:

1. User I am running with PowerShell is a site collection administrator.

2. Permission is not broken for any lists.

3. Above command runs with handlers fields and contenttypes.

4. No list has any item/document/page checked out. All data is checked in with major version published.

 

GetPnpProvisioningTemplateAccessDeniedError.png

 

1 Reply
Highlighted

Hi @Ross_Packwood 

it could be a Term Store Administration permission issue.

Could you check if your User is a Term Store Admin?

Cheers,

Federico