2

Piggy backing off my last question, Modifying Global Navigation Settings in SharePoint Online, is it possible to set a subsites navigation inheritance to use the same as the parent?

If it is possible via JSOM, I'm assuming it is possible via CSOM in Powershell or am I mistaken?

I've tried various iterations of this:

$Url = "https://tenant.sharepoint.com/teams/eric/DDD"
$context = New-Object Microsoft.SharePoint.Client.ClientContext($Url)
$context.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($credential.UserName, $credential.Password)

$currentWeb = $context.Web      
$web.Navigation.UseShared = $true
$context.ExecuteQuery()
0

1 Answer 1

3

I found this property for the Navigation class:

public bool UseShared { get; set; }

Setting it true should inherit the navigation. So this should work:

$web.Navigation.UseShared = $true;

However, it seems it applies to all navigation, top nav and quick launch.

2
  • It should, but I can't seem to get it to set. I've tried that before, it doesn't error, but it doesn't set the property either. Commented Aug 26, 2015 at 18:56
  • I must have had a typo somewhere or an invalid parameter reference, this works. Commented Aug 26, 2015 at 19:04

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.