Skip to content

Add new option to the spo hub site list command #709

Description

@arjenbloemsma

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

image

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

image

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

image

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions