SharePoint Online: “Edit User permissions”, “Remove User Permissions” greyed out!
Problem: In a SharePoint Online site, under site permissions, Users are unable to edit or remove user permissions as the “Edit user permissions” and “Remove user Permissions” buttons are disabled for everyone, including site owners and site collection administrators!
Root Cause:
This is because the SharePoint Online site is connected to a Microsoft Group, and permissions should be managed at the Office 365 Group-level instead of the SharePoint level. So, we cannot change the permissions through the web UI! Although we can swap the permissions of the Office 365 Group Owners/Members/Visitors through the site permissions link in the site settings menu, This doesn’t help when we have to change the site members permissions from “Edit” to “Contribute”!
Solution:
Although the user interface doesn’t support editing or removing user or group permissions, we can utilize the PowerShell script to edit user permissions in SharePoint Online.
$SiteURL = "https://crescent.sharepoint.com/sites/HR"
Try {
#Connect to PnP Online
Connect-PnPOnline -Url $SiteURL -Interactive
#Get the Default Members Group
$MembersGroup = Get-PnPGroup -AssociatedMemberGroup
#Grant "Contribute" permission to the Group and remove "Edit"
Set-PnPGroupPermissions -Identity $MembersGroup -AddRole "Contribute" -RemoveRole "Edit"
Write-Host "Removed 'Edit' Permissions and Granted 'Contribute' to $($MembersGroup.Title). " -foregroundcolor Green
}
Catch {
write-host -f Red "Error Setting Permissions!" $_.Exception.Message
}
Update for modern auth;
$SiteURL = “https://crescent.sharepoint.com/sites/HR”
Try {
#Connect to PnP Online
Connect-PnPOnline -Url $SiteURL -useweblogin
#Get the Default Members Group
$MembersGroup = Get-PnPGroup -AssociatedMemberGroup
#Grant “Contribute” permission to the Group and remove “Edit”
Set-PnPGroupPermissions -Identity $MembersGroup -AddRole “Contribute” -RemoveRole “Edit”
Write-Host “Removed ‘Edit’ Permissions and Granted ‘Contribute’ to $($MembersGroup.Title). ” -foregroundcolor Green
}
Catch {
write-host -f Red “Error Setting Permissions!” $_.Exception.Message
}
After struggling with this platform for several months, it is clear that SharePoint was not built for citizen users. It is built for IT experts. In short, the platform is anything but a collaboration platform when requires heavy IT support, which is not a viable solution for organizations without an IT department. I can’t believe that anyone pays for this service!
Thank You much!
Best regards