import Global from '../../_global.mdx';
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# spo homesite set

Updates an existing SharePoint home site.

## Usage

```sh
m365 spo homesite set [options]
```

## Options

```md definition-list
`-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`.
```

<Global />

## Remarks

:::info

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

:::

## Examples

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

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

Set the home site in draft mode

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

Set the audience to everyone

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

Set the audience to groups using groups Ids

```sh
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 to using their display name

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

Clear the audience and set to draft 

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

Configure multiple options

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

## Response

### Standard response

<Tabs>
  <TabItem value="JSON">

  ```json
  {
    "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"
  }
  ```

  </TabItem>
  <TabItem value="Text">

  ```text
  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
  ```

  </TabItem>
  <TabItem value="CSV">

  ```csv
  IsInDraftMode,IsVivaBackendSite,SiteId,TargetedLicenseType,Title,Url,VivaConnectionsDefaultStart,WebId
  1,0,431d7819-4aaf-49a1-b664-b2fe9e609b63,2,The Landing,https://contoso.sharepoint.com/sites/TheLanding,1,626c1724-8ac8-45d5-af87-c07c752fab75
  ```
  
  </TabItem>
  <TabItem value="Markdown">

  ```md
  # spo homesite set --url "https://contoso.sharepoint.com/sites/TheLanding" --vivaConnectionsDefaultStart "true" --audienceNames "active"

  Date: 7/27/2025

  ## The Landing (https://contoso.sharepoint.com/sites/TheLanding)

  Property | Value
  ---------|-------
  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
  ```
  </TabItem>
</Tabs>

## More information

- SharePoint home sites: a landing for your organization on the intelligent intranet: [https://techcommunity.microsoft.com/t5/Microsoft-SharePoint-Blog/SharePoint-home-sites-a-landing-for-your-organization-on-the/ba-p/621933](https://techcommunity.microsoft.com/t5/Microsoft-SharePoint-Blog/SharePoint-home-sites-a-landing-for-your-organization-on-the/ba-p/621933)
