How to update SharePoint’s Group Owner using PowerShell

  •  
  •  
  •  
  •  
  •  
  •  

#Enter the site URL for which the group owner needs to be updated
$webUrl = “http://test.company.com/man”

Write-Output “Getting site object”
$web = Get-SPWeb $webUrl
Write-Output “Success”

Write-Output “Getting User Group”
$spGroups = $web.groups
#Get the owner group
$UserGroup = $spGroups | where {$_.Name -eq “User”}
Write-Output “Success”

foreach($group in $spGroups)
{
if($group.Name.StartsWith(“User”))
{
Write-Output “Updating owner of group – $group”
$group.Owner = $UserGroup
$group.Update()
Write-Output “Successfully updated”
}
}

$web.Dispose()
Write-Output “script ended”

About Vishal Geet

Experienced Senior Technical Project Manager with a demonstrated history of working in the information technology and services industry. Skilled in SharePoint Technology, Requirements Analysis, Oracle Database, IT Strategy, Project Management and Data Warehousing.

View all posts by Vishal Geet →

Leave a Reply

Your email address will not be published.

17 − 2 =