Revoke-SPObjectSecurity
移除 SPObjectSecurity 物件的安全性主體。
語法
RevokeOne
Revoke-SPObjectSecurity
[-Identity] <SPObjectSecurity>
[-Principal] <SPClaim>
[[-Rights] <String[]>]
[-AssignmentCollection <SPAssignmentCollection>]
[<CommonParameters>]
RevokeAll
Revoke-SPObjectSecurity
[-Identity] <SPObjectSecurity>
[-All]
[-AssignmentCollection <SPAssignmentCollection>]
[<CommonParameters>]
Description
此 Cmdlet 包含一個以上的參數集。 您可能只會使用到一個參數集中的參數,而且您無法合併不同參數集中的參數。 如需如何使用參數集的詳細資訊,請參閱 Cmdlet 參數集。
指令本是 Revoke-SPObjectSecurity 用來移除 SPObjectSecurity 物件中安全主體(例如使用者)。
SPObjectSecurity 物件是一個常用物件,用來表示 SharePoint 管理物件(特別是服務應用程式) (ACL) 的安全存取控制清單。
如需適用於 SharePoint 產品的 Windows PowerShell 權限及最新資訊,請參閱線上文件 SharePoint Server Cmdlet。
範例
範例
$security = Get-SPServiceApplicationSecurity $serviceApp -Admin
Revoke-SPObjectSecurity $security "domain\user"
Set-SPServiceApplicationSecurity $serviceApp -Admin $security
此範例取得服務應用程式中對應管理員 ACL 的 SPObjectSecurity 物件,並將該 ACL 中的使用者移除。 移除的是服務應用程式 $serviceApp 的管理員。
參數
-All
適用:SharePoint Server 訂閱版本
指定要從指定 SPObjectSecurity 物件移除的所有安全性主體。
參數屬性
| 類型: | SwitchParameter |
| 預設值: | None |
| 支援萬用字元: | False |
| 不要顯示: | False |
參數集
RevokeAll
| Position: | Named |
| 必要: | True |
| 來自管線的值: | False |
| 來自管線按屬性名稱的值: | False |
| 來自剩餘引數的值: | False |
-AssignmentCollection
適用:SharePoint Server 訂閱版本
管理物件以適當處置它們。 使用 SPWeb 或 SPSite 等物件可能會耗用大量的記憶體,因此在 Windows PowerShell 指令碼中使用這些物件時,必須適當地管理記憶體。 您可以使用 SPAssignment 物件將物件指派給變數,並在不需要時處置這些物件,以釋放記憶體。 使用 SPWeb、SPSite 或 SPSiteAdministration 物件時,若未使用指派集合或 Global 參數,將會自動處置這些物件。
使用 Global 參數時,所有物件會包含在全域儲存區內。
如果不立即使用物件,或使用 Stop-SPAssignment 命令加以捨棄,則可能會有記憶體不足的狀況發生。
參數屬性
| 類型: | SPAssignmentCollection |
| 預設值: | None |
| 支援萬用字元: | False |
| 不要顯示: | False |
參數集
(All)
| Position: | Named |
| 必要: | False |
| 來自管線的值: | True |
| 來自管線按屬性名稱的值: | False |
| 來自剩餘引數的值: | False |
-Identity
適用:SharePoint Server 訂閱版本
指定要移除其安全性主體的 SPObjectSecurity 物件。
你可以用 Get-SPServiceApplicationSecurity cmdlet 取得 SPObjectSecurity 物件。
參數屬性
| 類型: | SPObjectSecurity |
| 預設值: | None |
| 支援萬用字元: | False |
| 不要顯示: | False |
參數集
(All)
| Position: | 1 |
| 必要: | True |
| 來自管線的值: | True |
| 來自管線按屬性名稱的值: | False |
| 來自剩餘引數的值: | False |
-Principal
適用:SharePoint Server 訂閱版本
指定要移除其權限的主體。
其類型必須是有效的主體名稱,例如 [完全控制]。
參數屬性
| 類型: | SPClaim |
| 預設值: | None |
| 支援萬用字元: | False |
| 不要顯示: | False |
參數集
RevokeOne
| Position: | 2 |
| 必要: | True |
| 來自管線的值: | False |
| 來自管線按屬性名稱的值: | False |
| 來自剩餘引數的值: | False |
-Rights
適用:SharePoint Server 訂閱版本
指定要撤銷的主體權限。
此類型必須是有效的字串陣列,代表要撤銷的主體權限。
參數屬性
| 類型: | String[] |
| 預設值: | None |
| 支援萬用字元: | False |
| 不要顯示: | False |
參數集
RevokeOne
| Position: | 3 |
| 必要: | False |
| 來自管線的值: | False |
| 來自管線按屬性名稱的值: | False |
| 來自剩餘引數的值: | False |
CommonParameters
此 cmdlet 支援常見參數:-Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutBuffer、-OutVariable、-PipelineVariable、-ProgressAction、-Verbose、-WarningAction 和 -WarningVariable。 如需詳細資訊,請參閱 about_CommonParameters。