Forum Discussion
johndpalm
Dec 15, 2020Brass Contributor
Set 'audiences to target' in SharePoint navigation using PowerShell
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 w...
thaBo77
Apr 07, 2022Copper Contributor
AudienceIds are a list of GUIDs, so try this one:
$audienceList = New-Object System.Collections.Generic.List[guid]
$audienceList.add([System.guid]::New(("YOURGROUPID")))
$node.AudienceIds = $audienceList
$node.Update()
Invoke-PnPQuery