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對象移除安全性主體的 Cmdlet,例如使用者。
SPObjectSecurity 對像是常見的物件,用來代表安全性訪問控制清單, (ACL) SharePoint 系統管理物件,特別是服務應用程式。
如需 SharePoint 產品 Windows PowerShell 的許可權和最新資訊,請參閱 () https://go.microsoft.com/fwlink/p/?LinkId=251831 在線檔https://go.microsoft.com/fwlink/p/?LinkId=251831。
範例
例
$security = Get-SPServiceApplicationSecurity $serviceApp -Admin
Revoke-SPObjectSecurity $security "domain\user"
Set-SPServiceApplicationSecurity $serviceApp -Admin $security
此範例會擷取對應至服務應用程式上系統管理員 ACL 的 SPObjectSecurity 物件,並從該 ACL 中移除使用者。 移除的是服務應用程式 $serviceApp 的管理員。
參數
-All
適用:SharePoint Server 2013、SharePoint Server 2016
指定要從指定 SPObjectSecurity 物件移除的所有安全性主體。
參數屬性
| 類型: | SwitchParameter |
| 預設值: | None |
| 支援萬用字元: | False |
| 不要顯示: | False |
參數集
RevokeAll
| Position: | Named |
| 必要: | True |
| 來自管線的值: | False |
| 來自管線按屬性名稱的值: | False |
| 來自剩餘引數的值: | False |
-AssignmentCollection
適用:SharePoint Server 2013、SharePoint Server 2016
管理物件以適當處置它們。 使用 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 2013、SharePoint Server 2016
指定要移除其安全性主體的 SPObjectSecurity 物件。
您可以使用 Cmdlet Get-SPServiceApplicationSecurity 來取得 SPObjectSecurity 物件 。
參數屬性
| 類型: | SPObjectSecurity |
| 預設值: | None |
| 支援萬用字元: | False |
| 不要顯示: | False |
參數集
(All)
| Position: | 1 |
| 必要: | True |
| 來自管線的值: | True |
| 來自管線按屬性名稱的值: | False |
| 來自剩餘引數的值: | False |
-Principal
適用:SharePoint Server 2013、SharePoint Server 2016
指定要移除其權限的主體。
其類型必須是有效的主體名稱,例如 [完全控制]。
參數屬性
| 類型: | SPClaim |
| 預設值: | None |
| 支援萬用字元: | False |
| 不要顯示: | False |
參數集
RevokeOne
| Position: | 2 |
| 必要: | True |
| 來自管線的值: | False |
| 來自管線按屬性名稱的值: | False |
| 來自剩餘引數的值: | False |
-Rights
適用:SharePoint Server 2013、SharePoint Server 2016
指定要撤銷的主體權限。
此類型必須是有效的字串陣列,代表要撤銷的主體權限。
參數屬性
| 類型: | 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。