| external help file | Microsoft.Online.SharePoint.PowerShell.dll-Help.xml |
|---|---|
| Module Name | Microsoft.Online.SharePoint.PowerShell |
| online version | https://learn.microsoft.com/powershell/module/microsoft.online.sharepoint.powershell/set-spositeoffice365group |
| applicable | SharePoint Online |
| title | Set-SPOSiteOffice365Group |
| schema | 2.0.0 |
| author | samkabue |
| ms.author | speedta |
| ms.reviewer |
Connects a top-level SPO site collection to a new Microsoft 365 Group.
Set-SPOSiteOffice365Group [-Site] <SpoSitePipeBind> [-DisplayName] <String> [-Alias] <String> [-IsPublic]
[[-Description] <String>] [[-Classification] <String>] [-KeepOldHomepage] [<CommonParameters>]
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.
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"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" -KeepOldHomepageApplicable: SharePoint Online
Specifies the email alias for the new Microsoft 365 Group that will be created.
Type: System.String
Parameter Sets: (All)
Aliases:
Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseApplicable: 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.
Type: System.String
Parameter Sets: (All)
Aliases:
Required: False
Position: 5
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseApplicable: SharePoint Online
Specifies the group's description.
Type: System.String
Parameter Sets: (All)
Aliases:
Required: False
Position: 4
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseApplicable: SharePoint Online
Specifies the name of the new Microsoft 365 Group that will be created.
Type: System.String
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseApplicable: SharePoint Online
Determines the Microsoft 365 Group's privacy setting. If switch is included, the group will be public, otherwise it will be private.
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseApplicable: 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.
Type: System.Management.Automation.SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: 6
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThe site collection being connected to new Office 365 Group.
Type: Microsoft.Online.SharePoint.PowerShell.SpoSitePipeBind
Parameter Sets: (All)
Aliases:
Required: True
Position: 0
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: FalseThis cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.