Commands › SharePoint Online

Set-SPOSiteOffice365Group

SharePoint Online Microsoft.Online.SharePoint.PowerShell Set-*

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

Quick start script

# Set-SPOSiteOffice365Group — quick start (serv365.ai)
# 1. Connect (app-only shown; interactive: omit the certificate parameters)
Connect-SPOService -Url https://$org-admin.sharepoint.com

# 2. Capture the current state first — you cannot roll back what you never recorded
$before = Get-SPOSiteOffice365Group
$before | Format-List

# 3. Make the change
Set-SPOSiteOffice365Group -Alias <String> -DisplayName <String> -Site <SpoSitePipeBind>

# 4. Verify and diff
$after = Get-SPOSiteOffice365Group
Compare-Object ($before | Out-String) ($after | Out-String)

Syntax

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

Parameters (7)

ParameterTypeRequiredWhat it controls
-Alias String yes Specifies the email alias for the new Microsoft 365 Group that will be created.
-Classification String 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.
-Description String Specifies the group's description.
-DisplayName String yes Specifies the name of the new Microsoft 365 Group that will be created.
-IsPublic SwitchParameter Determines the Microsoft 365 Group's privacy setting. If switch is included, the group will be public, otherwise it will be private.
-KeepOldHomepage SwitchParameter For sites that already have a modern page set as homepage, you can specify whether you want to keep it as the homepage.
-Site SpoSitePipeBind yes The site collection being connected to new Office 365 Group.

Reference facts derived from Microsoft documentation, © Microsoft, licensed CC BY 4.0; restructured with original guidance by serv365.ai.