none
How to rename a Sharepoint Group using Powershell

    Question

  • Hi,

    I need to rename a big number of Sharepoint Groups. Is there a way to rename a Sharepoint 2010 group programmatically using Powershell?

    Many thanks

    Mauimart

    Tuesday, April 02, 2013 7:51 PM

Answers

  • Hi Mauimart,

    Have try of the following commands:

    $site = Get-SPSite http://yourservername/sites/yoursitecollection 
    $groups = $site.RootWeb.sitegroups
    foreach ($grp in $groups) 
    {
       if($grp.name -eq "yourgroupname")
       {
         $grp.name="newname"
         $grp.update()
         "Group: " + $grp.name; //output the new name
       }
    }
    $site.Dispose()

    Best Regards.


    Kelly Chen
    TechNet Community Support

    Wednesday, April 03, 2013 6:31 AM
    Moderator