SharePoint 2010/2013: Modifying the Permission Level of a Group Using Powershell


well I had a SharePoint group with around 50 users given Contribute permission. Then it was required to raise its permission to “Full Control”. Here is how I did that using Powershell script:

Adding a Permission Level

$web = Get-SPWeb "http://SiteCollection"
$group = $web.SiteGroups["GroupName"]
roleAssignment= New-Object Microsoft.SharePoint.SPRoleAssignment($group)
$role = $web.RoleDefinitions["PermissionLevel"]

Removing a Permission Level

$web = get-spweb "http://SiteCollection"
$group = $web.SiteGroups["GroupName"]
$roleAssignment = $group.ParentWeb.RoleAssignments.GetAssignmentByPrincipal($group)
$role = $group.ParentWeb.RoleDefinitions["PermissionLevel"]


Post navigation

Leave a Reply

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