How to Change a Group Name in SharePoint Online?

Requirement: Change Group Name in SharePoint Online.

SharePoint Online: Change Group Name

Have you ever needed to change the name of a group in SharePoint Online? You need to update the names of your SharePoint groups to reflect their purpose or membership better. This blog post will walk you through the steps necessary to make this change. We’ll also provide some PowerShell scripts to change a group name in SharePoint Online.

To rename a SharePoint Online user group:

  1. Navigate to the site where the group is located >> Click on the gear icon in the top-right corner of the screen and select “Site settings” from the dropdown menu.
  2. Click on Site permissions >> Locate the group you want to rename from the list of available groups and click on its name to open the group details page.
  3. On the group page, click on “Group Settings” from the Settings Menu.
    sharepoint online change group name
  4. Provide a name for your SharePoint Online group. You can also modify the group’s description if desired. Once you have made your changes, click “Save” to apply the changes.
    sharepoint online rename group
  5. Click on OK to save your changes.

Rename a Group in SharePoint Online using PowerShell

You can rename a SharePoint group using PowerShell as well. Here is my PowerShell script to rename a group in SharePoint Online.

#Load SharePoint CSOM Assemblies
Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll"
Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"

#Function to Rename a Group
Function Rename-SPOGroup([String]$SiteURL, [String]$OldGroupName,[String]$NewGroupName)
{
    Try {
        #Get credentials to connect
        $Cred= Get-Credential
        $Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($Cred.Username, $Cred.Password)
 
        #Setup the context
        $Ctx = New-Object Microsoft.SharePoint.Client.ClientContext($SiteURL)
        $Ctx.Credentials = $Credentials

        #Get the Group by name
        $Group=$Ctx.web.SiteGroups.GetByName($OldGroupName)

        If($Group -ne $Null)
        {
            #Rename the group
            $Group.Title = $NewGroupName
            $Group.Update()
            $Ctx.ExecuteQuery()

            write-host -f Green "Group '$OldGroupName' Renamed to '$NewGroupName' Successfully!" $_.Exception.Message
        }
    }
    catch {
        write-host "Error Renaming Group: $($_.Exception.Message)" -foregroundcolor Red
    }
}

#Variables
$SiteURL="https://Crescent.sharepoint.com/"
$OldGroupName = "Team Site Members"
$NewGroupName = "Marketing Managers"

#Call the function
Rename-SPOGroup -SiteURL $SiteURL -OldGroupName $OldGroupName -NewGroupName $NewGroupName

PnP PowerShell to Change Group Name in SharePoint Online:

To rename a SharePoint Online group, use the Set-PnPGroup cmdlet in PnP PowerShell.

#Config Variables
$SiteURL = "https://Crescent.sharepoint.com/Sales"
$GroupName= "Sales Portal Members"
$NewGroupName ="Sales Managers"

#Connect PnP Online
Connect-PnPOnline -Url $SiteURL -Credentials (Get-Credential)

#Update the Group Name
Set-PnPGroup -Identity $GroupName -Title $NewGroupName

By following these steps, you can easily update the name of a group in SharePoint Online, and ensure that your team members can find and access the resources they need.

Salaudeen Rajack

Salaudeen Rajack - Information Technology Expert with Two-decades of hands-on experience, specializing in SharePoint, PowerShell, Microsoft 365, and related products. He has held various positions including SharePoint Architect, Administrator, Developer and consultant, has helped many organizations to implement and optimize SharePoint solutions. Known for his deep technical expertise, He's passionate about sharing the knowledge and insights to help others, through the real-world articles!

2 thoughts on “How to Change a Group Name in SharePoint Online?

  • Have you figured out how to accomplish this with Azure AD security groups that are defined in a site permission? They group names don’t seem to update ever (or be changeable in PnP) even after being renamed in AAD. The only way to have SPO recognize the new display name is to remove all references of the security group from the site collection, and then re-add it.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *