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.
Currently, we have 2 commands
spo site hubsite connectandspo 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:--asAdminEndpoint
The following endpoint should do the trick:
To disconnect a site, use the same request with
00000000-0000-0000-0000-000000000000as hub site ID.