Share via


Set-SPOSiteOffice365Group

Connects a top-level SPO site collection to a new Microsoft 365 Group.

Syntax

Default (Default)

Set-SPOSiteOffice365Group
    [-Site] <SpoSitePipeBind>
    [-DisplayName] <String>
    [-Alias] <String>
    [-IsPublic]
    [[-Description] <String>]
    [[-Classification] <String>]
    [-KeepOldHomepage]
    [<CommonParameters>]

Description

Connects a top-level SPO site collection to a new Microsoft 365 Group. You must be at least a SharePoint Online administrator to run the cmdlet and be a site collection administrator of the site.

If the site doesn't exist, this cmdlet returns a "File not found" error.

Examples

Example 1

This example creates a new Microsoft 365 Group named "site1group" and connects site collection https://contoso.sharepoint.com/sites/site1 to it. The group will have its privacy set to "Private" and Classification set to "Highly Confidential".

Set-SPOSiteOffice365Group -Site https://contoso.sharepoint.com/sites/site1 -DisplayName "site1group" -Alias "site1group" -Classification "Highly Confidential"

Example 2

This example creates a new Office 365 Group named "classicsite" and connects site collection https://contoso.sharepoint.com/sites/classicsite to it. It will keep the old home page from the classic site.

Set-SPOSiteOffice365Group -Site https://contoso.sharepoint.com/sites/classicsite -DisplayName "Classic Site" -Alias "classicsite" -KeepOldHomepage

Parameters

-Alias

Applicable: SharePoint Online

Specifies the email alias for the new Microsoft 365 Group that will be created.

Parameter properties

Type:System.String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:2
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Classification

Applicable: SharePoint Online

Specifies the classification value, if classifications are set for the organization. If no value is provided, the default classification will be set, if one is configured.

See Microsoft Entra cmdlets for configuring group settings and follow the steps in the Create settings at the directory level to define the classification for Office 365 groups.

See Manage Office 365 Groups with PowerShell for more information.

Parameter properties

Type:System.String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:5
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Description

Applicable: SharePoint Online

Specifies the group's description.

Parameter properties

Type:System.String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:4
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DisplayName

Applicable: SharePoint Online

Specifies the name of the new Microsoft 365 Group that will be created.

Parameter properties

Type:System.String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:1
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-IsPublic

Applicable: SharePoint Online

Determines the Microsoft 365 Group's privacy setting. If switch is included, the group will be public, otherwise it will be private.

Parameter properties

Type:System.Management.Automation.SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:3
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-KeepOldHomepage

Applicable: SharePoint Online

For sites that already have a modern page set as homepage, you can specify whether you want to keep it as the homepage.

Parameter properties

Type:System.Management.Automation.SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:6
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Site

The site collection being connected to new Office 365 Group.

Parameter properties

Type:Microsoft.Online.SharePoint.PowerShell.SpoSitePipeBind
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:0
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

Microsoft.Online.SharePoint.PowerShell.SpoSitePipeBind

Outputs

System.Object