1

I'm trying to list sites that are associated to a hub site from a PowerShell script. I'm using Microsoft.Online.SharePoint.Powershell.

I tried :

Get-SPOSite -Filter "HubSiteId eq ""121c78fe-bd38-474a-b6a7-1a7be148e8e8"""

However it fails with :

Get-SPOSite : Syntax error in the filter expression 'HubSiteId eq "121c78fe-bd38-474a-b6a7-1a7be148e8e8"'.

What's the proper way to get these sites ?

I also tried :

Get-SPOSite -Limit all | ? { $_.HubSiteID -eq [guid]"121c78fe-bd38-474a-b6a7-1a7be148e8e8" }

Nothing is returned. It seems that HubsiteId is not retrieved as all sites have an empty guid with this command, whilst retrieving a single one shows the correct hubsiteid.

-Detailled switch didn't help though

1

Using this module : "SharePointPnPPowerShellOnline" you can use : Get-PnPHubSiteChild -Identity "URL of your hub site".

Get-PnPHubSiteChild

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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