CLI for Microsoft 365 commands for SharePoint hub sites

Use the CLI for Microsoft 365 commands to create and manage SharePoint hub sites.

Note

The CLI for Microsoft 365 is an open-source solution with active community providing support for it. There is no SLA for the open-source tool support from Microsoft.

Get started

To run the CLI for Microsoft 365 commands, you'll need to do the following:

  1. Download and install NodeJS LTS version
  2. Follow the instructions at Installing the CLI to install the CLI for Microsoft 365 on your machine
  3. Follow the instructions at Logging in to Office 365 to connect to your SharePoint tenant.

To verify your setup and connection, try using the hubsite list command to list the current hub sites. If the cmdlet runs and returns with no errors, you're ready to proceed.

Hub site commands

The following commands are available for managing hub sites:

Command Description
hubsite connect Connects the specified site collection to the given hub site
hubsite data get Get hub site data for the specified site
hubsite disconnect Disconnects the specifies site collection from its hub site
hubsite get Gets information about the specified hub site
hubsite list Lists hub sites in the current tenant
hubsite register Registers the specified site collection as a hub site
hubsite rights grant Grants permissions to join the hub site for one or more principals
hubsite rights revoke Revokes rights to join sites to the specified hub site for one or more principals
hubsite set Updates properties of the specified hub site
hubsite theme sync Applies any theme updates from the parent hub site.
hubsite unregister Unregisters the specifies site collection as a hub site

See also