Skip to content

Connect and disconnect hub site as SP admin #5970

@milanholemans

Description

@milanholemans

Currently, we have 2 commands spo site hubsite connect and spo site hubsite disconnect. Right now, you need permission to the target site in order to run this command. I suggest we add an extra flag for these two commands:

Option Description
--asAdmin Run the command as admin for sites you don't have permission to.

Endpoint

The following endpoint should do the trick:

POST https://contoso-admin.sharepoint.com/_api/SPO.Tenant/ConnectSiteToHubSiteById
{
  "hubSiteId": "0cb3cff9-0578-4d70-bab4-bd1c796b9365",
  "siteUrl": "https://contoso.sharepoint.com/sites/Marketing"
}

To disconnect a site, use the same request with 00000000-0000-0000-0000-000000000000 as hub site ID.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions