GPPermissionCollection.RemoveTrustee Method (String)

 

Removes all policy-related permissions for the trustee that has the specified name from the GPPermissionCollection instance.

Namespace:   Microsoft.GroupPolicy
Assembly:  Microsoft.GroupPolicy.Management (in Microsoft.GroupPolicy.Management.dll)

Syntax

public void RemoveTrustee(
    string trustee
)
public:
void RemoveTrustee(
    String^ trustee
)
member RemoveTrustee : 
        trustee:string -> unit
Public Sub RemoveTrustee (
    trustee As String
)

Parameters

  • trustee
    Type: System.String

    The name of the trustee to remove. The name is specified in Security Accounts Manager (SAM) compatible format (Exampledomain\Someone). The trustee can also be specified as a SID.

Exceptions

Exception Condition
ArgumentException

trustee is an empty string (“”).

ArgumentNullException

trustee is null.

Remarks

A trustee is a user, computer, or security group that can be granted permissions on a GPO, SOM, or WMI filter.

On successful removal of a permission, the method updates all enumerators returned by the GetEnumerator method, even if a removal occurs during the enumeration of elements.

For more information about policy-related permissions, see GPPermissionType. For more information about security groups, see How Security Groups are Used in Access Control in the Active Directory Programmer's Guide.

See Also

RemoveTrustee Overload
GPPermissionCollection Class
Microsoft.GroupPolicy Namespace

Return to top