Set 'audiences to target' in SharePoint navigation using PowerShell

Occasional Contributor

I'm using PnP PowerShell to create SharePoint Hub navigation nodes (Add-PnPNavigationNode), but cannot find a way to configure the audience targeting via PowerShell.


I tried this.  It completed without error but it did NOT work:

$node = Get-PnPNavigationNode -Id 1234
Get-PnPProperty -ClientObject $node -Property "AudienceIds"


Any insight would be greatly appreciated!

5 Replies



As per my knowledge, currently it is not possible to set audience targeting groups to specific navigation node using PnP PowerShell.


You can only define if the navigation menu on a modern site should be enabled for modern audience using -NavAudienceTargetingEnabled parameter for Set-PnPWeb cmdlet. Check below reference:



Please click Mark as Best Response if my post helped you to solve your issue. This will help others to find the correct solution easily. It also closes the item. If the post was useful in other ways, please consider giving it Like.



Thanks! I'm aware of how to enable audience targeting through PowerShell.  I need to do the next step which is to add groups to the 'audiences to target' field.

Hi @johndpalm Is there any update on this? Could you please share the code to achieve this?

I never found an answer. I had to move on. I'll return to this post when I revisit the problem and find a solution.

AudienceIds are a list of GUIDs, so try this one:


$audienceList = New-Object System.Collections.Generic.List[guid]
$node.AudienceIds = $audienceList