I am trying to modify the permission level of SharePoint groups and users with direct permission using PowerShell, e.g. if group/user has been given full control, I need to modify it to read.

I have created a script which will remove that groups permission and add it again with read access. But, the issue here is that when I remove the group from site collection, it gets removed from all libraries also. So, for workaround I'm storing the group names in an array and again adding them to each library.

Is it possible to just modify the permission level of a SharePoint group and users with direct permission using PowerShell?


for($i = 0; $i -lt $WebRoleAssignments.Count; $i++){
$WebRoleAssignment = $web.RoleAssignments[$i]
$Member = $WebRoleAssignment.Member
Write-Host Default Permissions Removed for $Member

$assignment = new-object Microsoft.SharePoint.SPRoleAssignment($Member)
$permission = $web.RoleDefinitions["Read"]
Write-Host Read access granted for $Member
$groups += $Member

1 Answer 1


Try below code:

This will remove group permission full control

$web = get-spweb http://url/to/your/web
$group = $web.SiteGroups["Owners"]
$ra = $group.ParentWeb.RoleAssignments.GetAssignmentByPrincipal($group)
$rd = $group.ParentWeb.RoleDefinitions["Full Control"]

This will assign Read permission to group

# The following could be applied to a web or a user.
$web = get-spweb http://url/to/your/web
$group = $web.Groups["Owners"]
$role = $web.RoleDefinitions["Read"]

$RoleAssignment = New-Object Microsoft.SharePoint.SPRoleAssignment($group)

# the following could be for a web, list or item object

Change group names as per your requirement

  • Thanks Gautam, this code works perfectly for groups but I also have some users who have been granted access directly. With this code, it won't modify permission of the users.
    – kaz
    Nov 25, 2016 at 7:03
  • Ok, I got it. $groups = $web.Groups; $users = $web.Users This servers my purpose. Thanks a lot for guiding. :)
    – kaz
    Nov 25, 2016 at 7:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.