How to remove permission for a group from SharePoint 2010/2013 using Powershell?

Hello SharePointers,

Here are the powershell script to remove the Full Control permissionĀ from owners group.

$web = get-spweb http://mysharepoint
$group = $web.SiteGroups[“Owners”]
$role = $group.ParentWeb.RoleAssignments.GetAssignmentByPrincipal($group)
$roledef= $group.ParentWeb.RoleDefinitions[“Full Control”]
$role .RoleDefinitionBindings.Remove($roledef)
$role .Update()
$group.Update()
$web.Dispose()

Happy SharePointing šŸ™‚

Leave a Reply

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