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 isoptions
.--query [query]
JMESPath query string. See http://jmespath.org/ for more information and examples.
-o, --output [output]
Output type.
json
,text
,csv
,md
,none
. Defaultjson
.--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
Response
The command won't return a response on success.
More information
- SharePoint hub sites new in Microsoft 365: https://techcommunity.microsoft.com/t5/SharePoint-Blog/SharePoint-hub-sites-new-in-Office-365/ba-p/109547