[英]Remove all permissions from all security groups Powershell
I need to remove all the permissions in sharepoint to all security groups in Powershell. 我需要删除Powerpoint中所有安全组的sharepoint中的所有权限。
First, I'm trying to do this in all groups and here's my code: 首先,我试图在所有小组中做到这一点,这是我的代码:
$groups = $root.SiteGroups
foreach($group in $groups)
{
}
I only found the way to add with roles like this, but I want to remove all. 我只找到了添加这样的角色的方法,但我想删除所有角色。
$spRoleAssignment = New-Object Microsoft.SharePoint.SPRoleAssignment($spGroup)
$sproledefinition = $web.RoleDefinitions["Contribute"]
$sproleassignment.RoleDefinitionBindings.Add($sproledefinition)
thanks in advance. 提前致谢。
Jordi 乔迪
您可以使用RemoveAll()
从SPRoleAssignment中删除所有RoleDefinitionBindings
:
$sproleassignment.RoleDefinitionBindings.RemoveAll()
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.