Add-SPOHubSiteAssociation

Associates a site with a hub site.

Syntax

Add-SPOHubSiteAssociation
   [-Site] <SpoSitePipeBind>
   -HubSite <SpoHubSitePipeBind>
   [<CommonParameters>]

Description

Use this cmdlet to associate a site with a hub site.

Examples

Example 1

Add-SPOHubSiteAssociation https://contoso.sharepoint.com/sites/Research -HubSite https://contoso.sharepoint.com/sites/Marketing

This example associates the research site with the marketing hub site.

Parameters

-HubSite

URL or Site ID of the hub site.

Type:SpoSitePipeBind
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False
Applies to:SharePoint Online

-Site

URL of the site to join to the hub site.

Type:SpoSitePipeBind
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False
Applies to:SharePoint Online

Notes

If the site or hub site doesn't exist, this cmdlet returns a "File not found" error.

If the site is already a hub site, this cmdlet returns a "This site is already a HubSite" error.

In multi-geo situations, when assigning a hub that is across geo locations, you must pass the site ID of the hub site to the HubSite parameter as a URL will fail.