How to Change SharePoint Group Owner using PowerShell?

Change group owner in SharePoint site:

Have you ever needed to change the owner of a SharePoint group? Maybe someone left the company, and you need to transfer ownership to another user. PowerShell can help! In this blog post, I’ll show you how to use PowerShell to change the owner of a SharePoint group.

Follow these steps to update the SharePoint group owner in SharePoint.

  • Go to Site Settings >>  People and Groups
  • Pick the group you want from the Left navigation
  • From the group page, Click on Settings >> Group Settings >> Set the new group owner in “Group Owner” field. Hit OK to save your changes. This changes owner of the group.
how to change sharepoint group owner powershell

Changing the group owner from the SharePoint web user interface is quite simple. But At times, you may have to replace an existing group owner with a new user across multiple site collections. Ideally, we have to leverage PowerShell for these kinds of admin tasks. Let’s change the SharePoint group owner via PowerShell.

How to Change SharePoint Group Owner using PowerShell?

Here is the SharePoint PowerShell to update the group owner. You need to have either Farm Admin or Site collection Administrator permissions to change the group owner.

Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

#Parameters
$SiteURL="https://intranet.crescent.com/Sites/Operations"
$GroupName="Operations Site Owners"
$GroupOwner="Crescent\Salaudeen"

Try {
    #Get the Site and Group
    $Web = Get-SPWeb $SiteURL
    $Group = $web.SiteGroups[$GroupName]

    if ($Group -ne $null)
    {  
        #Get the User 
        $Owner = $web.EnsureUser($GroupOwner)

        #change group owner
        $Group.Owner = $Owner

        #Update the Group
        $Group.Update()
        Write-host -f Green "Group Owner updated successfully!"
    }
    else
    { 
        Write-host -f Yellow "Group Doesn't Exist!" 
    }
}
Catch {
    write-host -f Red "Error Changing Group Owner!" $_.Exception.Message
}

This PowerShell script changes the group owner programmatically for the given group name. By default, you can specify only one user as a Group owner, So it’s a good idea to set group owner to Farm Admin account or use SharePoint group as Group owner!

Update SharePoint Group Owners for All Groups using PowerShell:

While the above script changes the group owner for the given group name, Let’s change group owners for all groups in the entire site collection. Here is the PowerShell script to set group owners for all groups in the site collection.

Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

#Parameters
$SiteURL="https://intranet.crescent.com/Sites/Sales"
$GroupOwner="Crescent\Salaudeen"

Try {
    #Get all sites under given Site Collection
    $WebsCollection =  Get-SPSite $SiteURL | Get-SPWeb -Limit ALL
    
    #Loop through each web
    Foreach ($Web in $WebsCollection) 
    {
        Write-Host -f Yellow "Processing Web:"$Web.URL
        
        #Process the sites with unique permissions
        If($Web.HasUniqueRoleAssignments)
        {
            #Get the Group Owner User
            $Owner = $Web.EnsureUser($GroupOwner)

            #Get all Groups and Iterate through
            Foreach ($Group in $Web.Groups)
            {
                #Update the group owner                    
                $Group.Owner = $Owner
                $Group.Update()
                Write-host -f Green "Group Owner Updated for "$Group.Name
            }
        }
    }
}
Catch {
    write-host -f Red "Error Changing Group Owner!" $_.Exception.Message
}

Although this script is written to change all group owners for a given site collection, With slight changes to this script, You change the Group Owners of SharePoint Groups for any number of site collections. You can also change the script a bit to change owner of the group for an entire web application or even all web applications in the farm. Just change $WebsCollection to:

$WebsCollection =  Get-SPWebApplication | Get-SPSite  -Limit ALL | Get-SPWeb -Limit ALL
Tips: You can also assign an existing SharePoint group as a group owner in SharePoint! Here is how:
$GroupOwner = $web.SiteGroups[“Sales Site Owners”]

Here is another post to change group owner in SharePoint Online using PowerShell: How to Change SharePoint Online Group Owner using PowerShell?

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!

3 thoughts on “How to Change SharePoint Group Owner using PowerShell?

  • would it be possible to set an existing SharePoint group to be the owner of all of the groups in the same site collection?

    Reply
  • Second section “Update sharepoint group owners for all groups using PowerShell” will only sites which do have HasUniqueRoleAssignments means permission inheritance broken. Else statement block is missing

    Reply
    • If a site inherits permissions – which means: It inherits groups from the parent site. So, changing group owners at its parent site should be enough.

      Reply

Leave a Reply

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