Skip to main content

spo homesite set

Updates an existing SharePoint home site.

Usage​

m365 spo homesite set [options]

Options​

-u, --url <url>

The URL of the site to set as Home site.

--draftMode [draftMode]

Set draft status. Valid values are: true, false.

--audienceIds [audienceIds]

Comma-separated list of group Ids to set as audiences. Specify either audienceIds or audienceNames, but not both.

--audienceNames [audienceNames]

Comma-separated list of group names to set as audiences. You must use either audienceIds or audienceNames, but not both. Pass '' to clear audience.

--targetedLicenseType [targetedLicenseType]

Value of either everyone, frontLineWorkers or informationWorkers to create an experience for a distinct audience by license type.

--vivaConnectionsDefaultStart [vivaConnectionsDefaultStart]

Specifies whether the home site is the default start for Viva Connections. Accepts true or false.

-h, --help [help]

Output usage information. Optionally, specify which section of command's help you want to see. Allowed values are options, examples, remarks, permissions, response, full. Default is options.

--query [query]

JMESPath query string. See http://jmespath.org/ for more information and examples.

-o, --output [output]

Output type. json, text, csv, md, none. Default json.

--verbose

Runs command with verbose logging.

--debug

Runs command with debug logging.

Remarks​

info

To use this command you must be a Global or SharePoint administrator.

Permissions​

ResourcePermissions
SharePointAllSites.FullControl

Examples​

Sets the home site to the provided site collection url and sets the Viva Connections landing experience to the SharePoint home site

m365 spo homesite set --url https://contoso.sharepoint.com/sites/comms --vivaConnectionsDefaultStart true

Set the home site in draft mode

m365 spo homesite set --url https://contoso.sharepoint.com/sites/contosoportal --draftMode true

Set the audience to everyone

m365 spo homesite set --url https://contoso.sharepoint.com/sites/contosoportal --targetedLicenseType "everyone"

Set the audience to groups using groups Ids

m365 spo homesite set --url https://contoso.sharepoint.com/sites/contosoportal --audienceIds "978b5280-4f80-47ea-a1db-b0d1d2fb1ba4,21af775d-17b3-4637-94a4-2ba8625277cb"

Set the audience using their display name

m365 spo homesite set --url https://contoso.sharepoint.com/sites/contosoportal --audienceNames "Marketing, IT department"

Clear the audience and set to draft

m365 spo homesite set --url https://contoso.sharepoint.com/sites/contosoportal --audienceNames '' --draftMode true

Configure multiple options

m365 spo homesite set --url https://contoso.sharepoint.com/sites/contosoportal --audienceNames 'Marketing, IT department' --draftMode true --targetedLicenseType "everyone" --vivaConnectionsDefaultStart true

Response​

Standard response​

{
"Audiences": [
{
"Email": "active@contoso.onmicrosoft.com",
"Id": "7a1eea7f-9ab0-40ff-8f2e-0083d9d63451",
"Title": "active Members"
}
],
"IsInDraftMode": true,
"IsVivaBackendSite": false,
"SiteId": "431d7819-4aaf-49a1-b664-b2fe9e609b63",
"TargetedLicenseType": 2,
"Title": "The Landing",
"Url": "https://contoso.sharepoint.com/sites/TheLanding",
"VivaConnectionsDefaultStart": true,
"WebId": "626c1724-8ac8-45d5-af87-c07c752fab75"
}

More information​