Edit

Share via


Add-SPOHubSiteAssociation

Associates a site with a hub site.

Syntax

Default (Default)

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

Applicable: SharePoint Online

URL or Site ID of the hub site.

Parameter properties

Type:Microsoft.Online.SharePoint.PowerShell.SpoHubSitePipeBind
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Site

Applicable: SharePoint Online

URL of the site to join to the hub site.

Parameter properties

Type:Microsoft.Online.SharePoint.PowerShell.SpoSitePipeBind
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:0
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

Microsoft.Online.SharePoint.PowerShell.SpoSitePipeBind

Outputs

System.Object

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.