Revoke-SPObjectSecurity

 

**适用于:**SharePoint Server 2016

**上一次修改主题:**2015-03-09

Removes a security principal from a SPObjectSecurity object.

语法

Revoke-SPObjectSecurity [-Identity] <SPObjectSecurity> [-Principal] <SPClaim> [[-Rights] <String[]>] [-AssignmentCollection <SPAssignmentCollection>]

Revoke-SPObjectSecurity [-Identity] <SPObjectSecurity> -All <SwitchParameter> [-AssignmentCollection <SPAssignmentCollection>]

Detailed Description

此 cmdlet 包含多个参数集。您可以只使用来自一个参数集的参数,也可以不合并来自不同参数集的参数。有关如何使用参数集的详细信息,请参阅 Cmdlet 参数集

The Revoke-SPObjectSecurity cmdlet to remove a security principal, such as a user, from a SPObjectSecurity object. An SPObjectSecurity object is a common object that is used to represent the security access control list (ACL) of SharePoint administrative objects, in particular service applications.

有关适用于 SharePoint 产品的 Windows PowerShell 的权限和最新信息,请参阅适用于 SharePoint Server 2016 的 Windows PowerShell 参考上的联机文档。

参数

Parameter Required Type Description

Identity

Required

Microsoft.SharePoint.Administration.AccessControl.SPObjectSecurity

Specifies the SPObjectSecurity object from which the security principal is removed. You can use the Get- SPServiceApplicationSecurity cmdlet to get a SPObjectSecurity object .

Principal

Required

Microsoft.SharePoint.Administration.Claims.SPClaim

Specifies the principal for whom the rights are removed.

The type must a valid name a principal; for example, Full Control.

Rights

Optional

System.String[]

Specifies the rights of the principal to revoke.

The type must a valid array of strings that represents the rights of the principal to revoke.

All

Required

System.Management.Automation.SwitchParameter

Specifies that all security principals are removed from the specified SPObjectSecurity object.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

管理对象以便正确进行处理。使用 SPWebSPSite 等对象可能会耗用大量内存,而且在 Windows PowerShell 脚本中使用这些对象需要正确管理内存。通过使用 SPAssignment 对象,可以将对象分配给变量,然后在不需要这些对象时对它们进行处理,以释放内存。在使用 SPWebSPSiteSPSiteAdministration 对象时,如果不使用分配集合或 Global 参数,则会自动处理这些对象。

备注

在使用 Global 参数时,所有对象均包含在全局存储中。如果未立即使用对象,或未通过使用 Stop-SPAssignment 命令来处理对象,则可能会发生内存不足的情况。

Input Types

Return Types

示例

------------------EXAMPLE------------------

$security = Get-SPServiceApplicationSecurity $serviceApp -AdminRevoke-SPObjectSecurity $security "domain\user"Set-SPServiceApplicationSecurity $serviceApp -Admin $security

This example retrieves the SPObjectSecurity object corresponding to the administrator ACL on a service application, and removes a user from that ACL. The removed an administrator for the service application $serviceApp.

另请参阅

Grant-SPObjectSecurity
Get-SPServiceApplicationSecurity