Setting navigation nodes from template XML fails #899
Unanswered
Arnaudgrms
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
I am using the current version of Pnp.PowerShell (v2.2.0) to provision SharePoint sites. My script recently uses Legacy ACS authentication (with clientId/clientSecret).
Everything works fine except the QuickLaunch menu navigation nodes provisioning, when Invoke-PnpSiteTemplate cmdlet processes the pnp:Navigation node of the template XML, I get an "Access is denied" error while theapplication account normally has full rights to the site collection.
[PnP.Framework] [0] [Error] ExecuteQuery threw following exception: Microsoft.SharePoint.Client.ServerUnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)) at Microsoft.SharePoint.Client.ClientRequest.ProcessResponseStream(Stream responseStream) at Microsoft.SharePoint.Client.ClientRequest.ProcessResponse() at Microsoft.SharePoint.Client.ClientRequest.ExecuteQueryToServerAsync(ChunkStringBuilder sb) at Microsoft.SharePoint.Client.ClientRequest.ExecuteQueryAsync() at Microsoft.SharePoint.Client.ClientRuntimeContext.ExecuteQueryAsync() at Microsoft.SharePoint.Client.ClientContext.ExecuteQueryAsync() at Microsoft.SharePoint.Client.ClientContextExtensions.ExecuteQueryImplementation(ClientRuntimeContext clientContext, Int32 retryCount, String userAgent) ServerErrorCode: -2147024891 ServerErrorTypeName: System.UnauthorizedAccessException ServerErrorTraceCorrelationId: 0824c5a0-d016-6000-ce5e-8b64a57b0254 ServerErrorValue: ServerErrorDetails: . 0ms
Context :
Extract from the site template, navigation node:
<pnp:Navigation AddNewPagesToNavigation="true" CreateFriendlyUrlsForNewPages="true">
<pnp:GlobalNavigation NavigationType="Structural">
<pnp:StructuralNavigation RemoveExistingNodes="false" />
</pnp:GlobalNavigation>
<pnp:CurrentNavigation NavigationType="StructuralLocal">
<pnp:StructuralNavigation RemoveExistingNodes="true">
<pnp:NavigationNode Title="Accueil Docalys" Url="/sites/DOCALYS-AMENAGEMENT" IsExternal="true" />
<pnp:NavigationNode Title="Accueil" Url="{site}" />
<pnp:NavigationNode Title="Correspondances" Url="{site}/Documents partages/0-CORRESPONDANCES" />
<pnp:NavigationNode Title="Foncier" Url="{site}/Documents partages/1-FONCIER" />
<pnp:NavigationNode Title="Montage" Url="{site}/Documents partages/2-MONTAGE" />
<pnp:NavigationNode Title="Financier" Url="{site}/Documents partages/3-FINANCIER" />
<pnp:NavigationNode Title="Technique" Url="{site}/Documents partages/4-TECHNIQUE" />
<pnp:NavigationNode Title="Commercialisation" Url="{site}/Documents partages/5-COMMERCIALISATION" />
<pnp:NavigationNode Title="Rétrocession" Url="{site}/Documents partages/6-RETROCESSION" />
<pnp:NavigationNode Title="Communication" Url="{site}/Documents partages/7-COMMUNICATION" />
<pnp:NavigationNode Title="Dvpt durable" Url="{site}/Documents partages/8-DVPT-DURABLE" />
<pnp:NavigationNode Title="Photos" Url="{site}/Documents partages/9-PHOTOS" />
<pnp:NavigationNode Title="Contenu du site" Url="{site}/_layouts/15/viewlsts.aspx" IsExternal="true" />
</pnp:StructuralNavigation>
</pnp:CurrentNavigation>
</pnp:Navigation>
However, when I run add-PnpNavigationNode directly, I don't encounter the problem, it works fine.
Have you ever encountered this type of problem? Is it really a problem with access rights for my application account? A bug?
Beta Was this translation helpful? Give feedback.
All reactions