简体   繁体   English

从所有安全组Powershell中删除所有权限

[英]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.

相关问题 从所有组中删除 AzureAD 用户 -powershell - Remove AzureAD user from all groups -powershell PowerShell:删除所有用户对目录的所有权限 - PowerShell: Remove all permissions on a directory for all users PowerShell:从文件中删除所有权限,包括。 应用程序包 - PowerShell: Remove all permissions from a file incl. APPLICATION PACKAGES powershell - 从 SID 选择的 AD 组中删除所有“ForeignSecurityPrincipals” - powershell - Remove all "ForeignSecurityPrincipals" from AD Groups selected by SID powershell 删除特定用户对文件夹的所有权限 - powershell remove all permissions on a folder for a specific user 如何使用 Powershell 删除所有有例外的组? - How to remove All Groups with Exceptions by using Powershell? 有没有办法使用 PowerShell 从 SharePoint 在线组中删除安全组? - Is there a way to remove security groups from SharePoint Online groups using PowerShell? 用于从 AD 组中删除成员的 Powershell 脚本不适用于所有组/用户 - Powershell script to remove members from AD groups not working on all groups/users PowerShell 查找所有没有成员或计算机对象的空 AD 安全组 - PowerShell to find all empty AD Security Groups with no Members OR Computer Objects 尝试使用PowerShell脚本从Active Directory中的所有组中删除用户 - Trying to remove user from all groups in an Active Directory using PowerShell script
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM