Skip to content

spo hubsite connect

Connects the specified site collection to the given hub site


m365 spo hubsite connect [options]


-u, --url <url>
The URL of the site collection to connect to the hub site
-i, --hubSiteId <hubSiteId>
The ID of the hub site to which to connect the site collection
-h, --help
output usage information
--query [query]
JMESPath query string. See for more information and examples
-o, --output [output]
Output type. json,text,csv. Default json
Runs command with verbose logging
Runs command with debug logging



This command is based on a SharePoint API that is currently in preview and is subject to change once the API reached general availability.

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 hubSiteId doesn't point to a valid hub site, you will get a ResourceNotFoundException error.


Connect the site collection with URL to the hub site with ID 255a50b2-527f-4413-8485-57f4c17a24d1

m365 spo hubsite connect --url --hubSiteId 255a50b2-527f-4413-8485-57f4c17a24d1

More information