IGPMSecurityInfo::Remove method

Removes the permission specified in a given GPMPermission object from the GPMSecurityInfo collection.

Syntax


HRESULT Remove(
        objGPMPermission,
  [in] IGPMPermission *pPerm
);

Parameters

objGPMPermission

GPMPermission object to remove.

pPerm [in]

Pointer to the GPMPermission object to remove from the collection.

Return value

JScript

Returns S_OK if successful. Returns a failure code if an error occurs.

VB

Returns S_OK if successful. Returns a failure code if an error occurs.

Remarks

You cannot remove Inherited permissions. To determine if a permission is Inherited, see IGPMPermission Property Methods.

The method checks for the existence of the specified GPMPermission object, which is the pairing of a trustee (which is a user, computer, or security group) and a permission that applies to a single object, for example, to a GPO, SOM, or WMI filter. If the object exists in the collection, the method removes it.

If the permission specified for removal represents a higher level than the permission that exists for the trustee, the method removes the lower level permission. An example of this situation is specifying the removal of the permGPOEditSecurityAndDelete permission when the trustee has the lower permGPOEdit permission instead. In this case, the method removes the permGPOEdit permission.

If the permission specified for removal represents a lower level than the permission that exists for the trustee, the method returns S_FALSE.

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

For more information about policy-related permissions, see IGPM::CreatePermission.

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

Requirements

Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2008

Header

Gpmgmt.h

IDL

Gpmgmt.idl

DLL

Gpmgmt.dll

IID

IID_IGPMSecurityInfo is defined as B6C31ED4-1C93-4D3E-AE84-EB6D61161B60

See also

IGPMSecurityInfo
IGPMTrustee
IGPMPermission

 

 

Show: