Commands › SharePoint Online

Add-SPOHubSiteAssociation

SharePoint Online Microsoft.Online.SharePoint.PowerShell Add-*

Associates a site with a hub site.

Quick start script

# Add-SPOHubSiteAssociation — quick start (serv365.ai)
# 1. Connect (app-only shown; interactive: omit the certificate parameters)
Connect-SPOService -Url https://$org-admin.sharepoint.com

# 2. Run and inspect
Add-SPOHubSiteAssociation -HubSite <SpoHubSitePipeBind> -Site <SpoSitePipeBind> | Format-List

# 3. Export for evidence / drift tracking
Add-SPOHubSiteAssociation | Export-Clixml .\SPOHubSiteAssociation-$(Get-Date -Format yyyyMMdd).xml

Syntax

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

Parameters (2)

ParameterTypeRequiredWhat it controls
-HubSite SpoHubSitePipeBind yes URL or Site ID of the hub site.
-Site SpoSitePipeBind yes URL of the site to join to the hub site.

Reference facts derived from Microsoft documentation, © Microsoft, licensed CC BY 4.0; restructured with original guidance by serv365.ai.