How to Rename a SharePoint Group using PowerShell?

Requirement: On a marketing site, site owner wanted to rename "Marketing Members" group name to "Marketing Managers" as it makes more sense to him.

How to Rename a SharePoint Group?
To rename a SharePoint 2013 user group, Navigate to:
  • Site settings >> Site permissions >> Pick your target group
  • Click on "Group Settings" from Settings Menu
    how to rename sharepoint group
  • Supply a new name for your SharePoint permission group.
    sharepoint 2013 rename security group
  • Click on OK to save your changes.
Pretty straightforward, isn't it?

Rename SharePoint group using PowerShell:
Renaming SharePoint groups can be achieved with PowerShell too. Here is my PowerShell script to rename a group in SharePoint 2013:
#sharepoint powershell change group name
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

$SiteURL = ""
$GroupName = "Marketing Members" 
$GroupNewName ="Marketing Managers"

#Get site and Group objects
$Site = Get-SPSite $SiteURL
$Group = $Site.RootWeb.SiteGroups[$GroupName]

if($Group -ne $null)
        #sharepoint rename permission group
        $ = $GroupNewName
        #Update the group
        Write-host "Group Name has been updated!" 
#dispose site object
This PowerShell changes SharePoint group name!

No comments:

Please Login and comment to get your questions answered!

Powered by Blogger.