Skip to content

spo hubsite list

Lists hub sites in the current tenant

Usage

m365 spo hubsite list [options]

Options

-i, --includeAssociatedSites
Include the associated sites in the result (only in JSON output)
-h, --help [help]
Output usage information. Optionally, specify which section of command's help you want to see. Allowed values are options, examples, remarks, response, full. Default is full.
--query [query]
JMESPath query string. See http://jmespath.org/ for more information and examples
-o, --output [output]
Output type. json,text,csv,md. Default json
--verbose
Runs command with verbose logging
--debug
Runs command with debug logging

Remarks

When using the text or csv output type, the command lists only the values of the ID, SiteUrl and Title properties of the hub site. With the output type as JSON, all available properties are included in the command output.

Examples

List hub sites in the current tenant

m365 spo hubsite list

List hub sites, including their associated sites, in the current tenant. Associated site info is only shown in JSON output.

m365 spo hubsite list --includeAssociatedSites --output json

Response

Standard response

[
  {
    "Description": "Intranet Hub Site",
    "EnablePermissionsSync": false,
    "EnforcedECTs": null,
    "EnforcedECTsVersion": 0,
    "HideNameInNavigation": false,
    "ID": "af80c11f-0138-4d72-bb37-514542c3aabb",
    "LogoUrl": "https://contoso.sharepoint.com/sites/intra/SiteAssets/work.png",
    "ParentHubSiteId": "ec78f3aa-5a74-4f16-be49-3396df045f34",
    "PermissionsSyncTag": 0,
    "RequiresJoinApproval": false,
    "SiteDesignId": "184644fb-90ed-4841-a7ad-6930cf819060",
    "SiteId": "af80c11f-0138-4d72-bb37-514542c3aabb",
    "SiteUrl": "https://contoso.sharepoint.com/sites/intra",
    "Targets": null,
    "TenantInstanceId": "5d128b52-7228-46b5-8765-5b338476054d",
    "Title": "Intranet"
  }
]
ID                                    SiteUrl                                     Title
------------------------------------  ------------------------------------------  --------
af80c11f-0138-4d72-bb37-514542c3aabb  https://contoso.sharepoint.com/sites/intra  Intranet
ID,SiteUrl,Title
af80c11f-0138-4d72-bb37-514542c3aabb,https://contoso.sharepoint.com/sites/intra,Intranet

includeAssociatedSites response

When we make use of the option includeAssociatedSites the response will differ.

[
  {
    "Description": "Intranet Hub Site",
    "EnablePermissionsSync": false,
    "EnforcedECTs": null,
    "EnforcedECTsVersion": 0,
    "HideNameInNavigation": false,
    "ID": "af80c11f-0138-4d72-bb37-514542c3aabb",
    "LogoUrl": "https://contoso.sharepoint.com/sites/intra/SiteAssets/work.png",
    "ParentHubSiteId": "ec78f3aa-5a74-4f16-be49-3396df045f34",
    "PermissionsSyncTag": 0,
    "RequiresJoinApproval": false,
    "SiteDesignId": "184644fb-90ed-4841-a7ad-6930cf819060",
    "SiteId": "af80c11f-0138-4d72-bb37-514542c3aabb",
    "SiteUrl": "https://contoso.sharepoint.com/sites/intra",
    "Targets": null,
    "TenantInstanceId": "5d128b52-7228-46b5-8765-5b338476054d",
    "Title": "Intranet",
    "AssociatedSites": [
      {
        "Title": "About Us",
        "SiteUrl": "https://contoso.sharepoint.com/sites/about-us"
      }
    ]
  }
]
ID                                    SiteUrl                                     Title
------------------------------------  ------------------------------------------  --------
af80c11f-0138-4d72-bb37-514542c3aabb  https://contoso.sharepoint.com/sites/intra  Intranet
ID,SiteUrl,Title
af80c11f-0138-4d72-bb37-514542c3aabb,https://contoso.sharepoint.com/sites/intra,Intranet

More information