Add new option to the spo hub site list command
See original GitHub issueI would like to propose to extend the command spo hubsite list
with a new option --includeAssociatedSites
, which will be the o365cli version of the info presented in the column “Hub site association” that is shown in the “Active Sites” overview of the new Central Admin experience.

Currently the spo hubsite list commands shows something like the following:

In the new situation, if the user provides the --includeAssociatedSites
option, something like the following would be shown:

The JSON for the new situation would be the same as in the current situation, but with an additional AssociatedSites property for each Hub element:
[{
"Description": null,
"ID": "77f50c57-c40a-4666-83f5-d325567512be",
"LogoUrl": null,
"RequiresJoinApproval": false,
"SiteDesignId": "00000000-0000-0000-0000-000000000000",
"SiteId": "77f50c57-c40a-4666-83f5-d325567512be",
"SiteUrl": "https://contoso.sharepoint.com/sites/RootHub",
"Targets": null,
"TenantInstanceId": "4b336ff8-ab07-4830-1981-13d9ad7baf63",
"Title": "Awesome Hub",
"AssociatedSites": [{
"Title": "Hub sub 1",
"SiteUrl": "https://contoso.sharepoint.com/sites/hubsub1"
}, {
"Title": "Hub sub 3",
"SiteUrl": "https://contoso.sharepoint.com/sites/hubsub3"
}, {
"Title": "Hub sub 4",
"SiteUrl": "https://contoso.sharepoint.com/sites/hubsub4"
}, {
"Title": "Hub sub x",
"SiteUrl": "https://contoso.sharepoint.com/sites/hubsubx"
}
]
}]
Since the hub site REST API currently does not provide the required info, we would retrieve the associated sites info in the same way as the “Active Sites” overview of the new Central Admin experience does; by retrieving this info from list DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECOLLECTIONS. When we use a tool like Fiddler we can see that to get the required hubsite info for the “Active Sites” overview the data from the /_api/HubSites and _api/web/lists/GetByTitle(‘DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECOLLECTIONS’) calls are combined.
I understand that since this isn’t done via an exposed API this all could change in a future update to SPO and thus that this functionality will break in the o365cli, however, I also do think that this is quite conviniant info about hub sites that some users working with hub sites really would like to retrieve via the o365cli.
What do you guys think? Is this something that could be a useful addition to the o365cli?
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (5 by maintainers)
You could store the batch size in a private class property and then in the test set it to a smaller number. To do this you would need to cast the class instance to any, but other than that it should work just fine.
Yeah! I would really like that.
And thanks 👊🏻