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.

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

  1. Change the Team display name and description
  2. Change the Team mail alias and email addresses
  3. Rename Team SharePoint online site

Rename the Team using PowerShell Set-Team

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 
# 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

# 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 

Related Posts

 

Comments

No comments made yet. Be the first to submit a comment
Already Registered? Login Here
Thursday, 01 June 2023
You can help support this website by buying me a coffee!
Buy Me A Coffee
Cron Job Starts