Refresh Updated Security Group Name in SharePoint Online Sites

Daniel Chee 251 Reputation points
2021-09-07T01:27:23.347+00:00

Hi MS Q&A,

Seeking advice and recommendation if it is possible to via PowerShell to manually refresh a renamed Security Group name reflected against SharePoint Online Sites or it will automatically reflect updated name over time?

Example:
Security Group A had been granted permission to a SharePoint Online site.
Security Group A has been renamed via AAD to Security Group B.
SharePoint Online site still shows Security Group A and does not refresh to display updated name.

People Picker shows updated Security Group name subsequently after rename, however re-adding the same Security Group will still show up with the old name.
The displayed name was only able to update once purging the Security Group from the All People listing (.../_layouts/15/people.aspx?MembershipGroupId=0), however this is not preferred in cases where the Security Group might be explicitly associated on multiple subsites / items and attracts increased overheads to track and re-apply explicit permissions.

Appreciate any advice or information.

Thank you.

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,262 questions
0 comments No comments
{count} votes

9 answers

Sort by: Most helpful
  1. Alex Rademeyer 1 Reputation point
    2023-04-18T12:33:13.7833333+00:00

    Same here.
    rename a group, but the original display name is visible in Sharepoint UI and Sharepoint admin center.

    0 comments No comments

  2. Paweł Litwin 0 Reputation points
    2023-11-16T09:01:05.39+00:00

    Hey all, i am using powershell script to change names on old site collections where we have many libraries and lists with splitted permissions. Please check below and change for your tenant ;)

    #User login
    $userName ="login@email.com" 
    
    #User password
    $password = "pa$$word"
    
    $securePassword = ConvertTo-SecureString $password -AsPlainText -Force 
    
    #site collections where you want to change old name
    $siteCollections = "https://contoso.sharepoint.com/sites/contoso1", "https://contoso.sharepoint.com/sites/contoso2", "https://contoso.sharepoint.com/sites/contoso3"
    #Type group names like --> Old_Group_Name|New_Group_Name;Old_Group_Name_2|New_Group_Name_2
    $groupsToChangeTitle = "Legal Department|Legal Department Team New"
    
    $currentDirectory = Get-Location
    $SPClientPath = $currentDirectory.Path + "\Microsoft.SharePoint.Client.dll"
    $SPClientRuntimePath = $currentDirectory.Path + "\Microsoft.SharePoint.Client.Runtime.dll"
    Add-Type -Path  $SPClientPath
    Add-Type -Path  $SPClientRuntimePath
    foreach($siteCollection in $siteCollections)
    {
        $clientContext = New-Object Microsoft.SharePoint.Client.ClientContext($siteCollection)
        $credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($userName, $securePassword)
        $clientContext.Credentials = $credentials
            if (!$clientContext.ServerObjectIsNull.Value) 
            {  
                Write-Host "Connected to SharePoint Online site: '$siteCollection'" -ForegroundColor Green
                $web = $clientContext.Web
                $listUser = $web.SiteUserInfoList
              
                $splitedGroups = $groupsToChangeTitle.Split(";")
                foreach($groupToChange in $splitedGroups)
                {
                    $oldTitle = $groupToChange.Split("|")[0]
                    $newTitle = $groupToChange.Split("|")[1]
                    $camlquery = New-Object Microsoft.SharePoint.Client.CamlQuery
                    $camlQuery.ViewXml="<View Scope='RecursiveAll'><Query><Where><Eq><FieldRef Name='Title' /><Value Type='Text'>" + $oldTitle + "</Value></Eq></Where></Query><RowLimit>10000</RowLimit></View>";
                   
    
                    $listItemsCollection = $listUser.GetItems($camlquery)
    
                    $clientContext.Load($listItemsCollection)
                    $clientContext.ExecuteQuery()
                    foreach($item in $listItemsCollection)
                    {
                     if($item["Title"] -eq $oldTitle)
                        {
                            $item["Title"] = $newTitle
                            $item["Name"] = $newTitle
                            $item.Update()
                            $clientContext.ExecuteQuery();
                            Write-Host "Group name changed from '$oldTitle' to '$newTitle' " -ForegroundColor Blue
                        }
                    }
                }
    
            }
    }
    
    0 comments No comments

  3. Nick Horner 0 Reputation points
    2024-01-22T10:28:14.2933333+00:00

    Any update on a solution for this?

    0 comments No comments

  4. Luke-8959 0 Reputation points
    2024-06-04T01:47:29.77+00:00

    Same issue, any solution? It seems problematic the changed name isn't reflected in SP but is in AZ.

    0 comments No comments