Skip to main content

spo hubsite connect

Connect a hub site to a parent hub site

Usage

m365 spo hubsite connect [options]

Options

-i, --id [id]

ID of the hub site. Specify either id, title, or url but not multiple.

-t, --title [title]

Title of the hub site. Specify either id, title, or url but not multiple.

-u, --url [url]

Absolute or server-relative URL of the hub site. Specify either id, title, or url but not multiple.

--parentId [parentId]

ID of the parent hub site. Specify either parentId, parentTitle, or parentUrl but not multiple.

--parentTitle [parentTitle]

Title of the parent hub site. Specify either parentId, parentTitle, or parentUrl but not multiple.

--parentUrl [parentUrl]

Absolute or server-relative URL of the parent hub site. Specify either parentId, parentTitle, or parentUrl but not multiple.

-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 options.

--query [query]

JMESPath query string. See http://jmespath.org/ for more information and examples.

-o, --output [output]

Output type. json, text, csv, md, none. Default json.

--verbose

Runs command with verbose logging.

--debug

Runs command with debug logging.

Remarks

info

To use this command you must be a Global or SharePoint administrator.

To connect a regular site to a hub site, use command spo site hubsite connect.

Examples

Connect a specific hub site to specific parent hub site by ID.

m365 spo hubsite connect --id 2c1ba4c4-cd9b-4417-832f-92a34bc34b2a --parentId 637ed2ea-b65b-4a4b-a3d7-ad86953224a4

Connect a specific hub site to specific parent hub site by URL.

m365 spo hubsite connect --url https://contoso.sharepoint.com/sites/project-x --parentUrl https://contoso.sharepoint.com/sites/projects

Connect a specific hub site with title to a parent hub site with ID.

m365 spo hubsite connect --title "My hub site" --parentId 637ed2ea-b65b-4a4b-a3d7-ad86953224a4

Response

The command won't return a response on success.

CTRL + M