Skip to content

New command: spo hubsite disconnect #3760

@milanholemans

Description

@milanholemans

Usage

m365 spo hubsite disconnect

Description

Disconnects the specified site collection from its parent hub site.

Options

Option Description
-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] URL of the hub site. Specify either id, title or url but not multiple.
--confirm Don't prompt for confirmation.

Examples

Disconnects hub site from its parent by ID

m365 spo hubsite disconnect --idbd78e5e7-c1d3-4711-9151-c161f872572c 

Disconnects hub site from its parent by URL

m365 spo hubsite disconnect --url"https://contoso.sharepoint.com/sites/HubSite"

Additional Info

We could use the spo hubsite get command to get the ID of the hubsite.

After that we should execute the following API request:

PATCH https://tenant.sharepoint.com/sites/project-x/_api/HubSites/GetById('<hubsite ID>')
If-Match: <etag value>

{
   "ParentHubSiteId": "00000000-0000-0000-0000-000000000000"
}

Blocking issue

This issue is blocked until this issue has been completed:

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions