Skip to content

spo site hubsite connect

Connects the specified site collection to the given hub site

Usage

m365 spo site hubsite connect [options]

Options

-u, --siteUrl <siteUrl>
The URL of the site collection to connect to the hub site
-i, --id <id>
The ID of the hub site to which to connect the site collection
-h, --help [help]
Output usage information. Optionally, specify which section of command's help you want to see. Allowed values are options, examples, remarks, response, full. Default is full.
--query [query]
JMESPath query string. See http://jmespath.org/ for more information and examples
-o, --output [output]
Output type. json,text,csv. Default json
--verbose
Runs command with verbose logging
--debug
Runs command with debug logging

Remarks

If the specified site collection is already connected to a hub site, it will be disconnected and connected to the newly specified hub site.

If the specified id doesn't point to a valid hub site, you will get a ResourceNotFoundException error.

Examples

Connect a specific site collection to a hub site

m365 spo site hubsite connect --siteUrl https://contoso.sharepoint.com/sites/contoso-sales --id 255a50b2-527f-4413-8485-57f4c17a24d1

More information