3 minutes reading time
(510 words)
Rename Microsoft 365 Team and related resources using PowerShell
How to rename an Office 365 Team using PowerShell. Change the Team display name and description, change Team email addresses and rename the Team SharePoint online site.

Create Microsoft Team and configure Office 365 group settings using PowerShell - TechLabs
How to create a Microsoft Team and change Office 365 unified group settings using PowerShell
What resources are included with a Team?
When you create a Team, these Office 365 resources are also created:
- Microsoft 365 group
- Exchange online mailbox
- SharePoint online site
Steps to rename a Team
- Change the Team display name and description
- Change the Team mail alias and email addresses
- Rename Team SharePoint online site
In this example, we are renaming the "London Sales" Team to "UK Sales"
Rename the Team using PowerShell Set-Team
Changes to Teams made using PowerShell can take up to two hours to take effect
Change the Team display name and description
# Connect to Teams online Connect-MicrosoftTeams # Get Team Group ID $Group = Get-Team -DisplayName "London Sales" | select GroupId # Change Team display name and description Set-Team -Group $Group.GroupId -DisplayName "UK Sales" -Description "UK Sales Team"
# Get Team display name and description Get-Team -DisplayName "UK Sales" | Select DisplayName, Description | ft
Change the Team email address using PowerShell Set-UnifiedGroup
Set a new Team primary email address and change the mail alias using Exchange online PowerShell
# Connect to Exchange Online PowerShell Connect-ExchangeOnline -UserPrincipalName itadmin@ctrlf.cloud # get M365 group email addresses Get-UnifiedGroup -Identity "UK Sales" | select DisplayName, Alias, PrimarySmtpAddress, EmailAddresses | fl
The old smtp email addresses will get overwritten when we run Set-UnifiedGroup -EmailAddresses
smtp:LondonSales@ctrlfcloud.onmicrosoft.com
SMTP:LondonSales@ctrlf.cloud
smtp:LondonSales@ctrlfcloud.onmicrosoft.com
SMTP:LondonSales@ctrlf.cloud
# change email alias and primary smtp address Set-UnifiedGroup -Identity "UK Sales" -Alias UKSales -PrimarySmtpAddress uksales@ctrlf.cloud # add new email addresses Set-UnifiedGroup -Identity "UK Sales" -EmailAddresses uksales@ctrlf.cloud,uksales@ctrlfcloud.onmicrosoft.com
Rename Team SharePoint online site using PowerShell
Install SharePoint online PowerShell module and connect to SharePoint Online
# Install SharePoint online PowerShell module Install-Module -Name Microsoft.Online.SharePoint.PowerShell # Connect to SharePoint online using MFA Connect-SPOService -Url https://ctrlfcloud-admin.sharepoint.com
Get Team SharePoint site URL using Exchange Online PowerShell
# Connect to Exchange online Connect-ExchangeOnline -UserPrincipalName itadmin@ctrlf.cloud # Get Team SharePoint site URL Get-UnifiedGroup -Identity "UK Sales" | Select DisplayName,SharePointSiteUrl,SharepointDocumentsUrl | fl
Rename Team SharePoint online site using PowerShell Start-SPOSiteRename
Run Start-SPOSiteRename with the -ValidationOnly option first to check if the site can be renamed
# check if the sharepoint site can be renamed using -ValidationOnly Start-SPOSiteRename -Identity https://ctrlfcloud.sharepoint.com/sites/LondonSales -NewSiteUrl https://ctrlfcloud.sharepoint.com/sites/UKSales -ValidationOnly
# rename the Team sharepoint site url Start-SPOSiteRename -Identity https://ctrlfcloud.sharepoint.com/sites/LondonSales -NewSiteUrl https://ctrlfcloud.sharepoint.com/sites/UKSales
Team has been renamed to "UK Sales"
References:
SharePoint Change a site address
https://docs.microsoft.com/en-us/sharepoint/change-site-addressMicrosoft Teams PowerShell Set-Team
https://docs.microsoft.com/en-us/powershell/module/teams/set-teamExchange PowerShell Set-UnifiedGroup
by Author
https://docs.microsoft.com/en-us/powershell/module/exchange/set-unifiedgroup
Comments