<div class="content" name="SamrRemoveMemberFromGroup" uuid="613ff663-5863-4430-8923-8f1edc05310b"><p>The SamrRemoveMemberFromGroup method removes a member from a
group.</p><dl>
<dd>
<div><pre> long SamrRemoveMemberFromGroup(
   [in] SAMPR_HANDLE GroupHandle,
   [in] unsigned long MemberId
 );
</pre></div>
</dd></dl><p><b>GroupHandle: </b>An RPC context handle, as
specified in section <span><a href="8138c078-d881-4d1f-b378-94b4c34a287a" data-linktype="relative-path">2.2.7.2</a></span>,
representing a <span><a href="7b2aeb27-92fc-41f6-8437-deb65d950921#gt_7ce4771c-2043-49b8-85d3-0c60c7789f9a" data-linktype="relative-path">group object</a></span>.</p><p><b>MemberId: </b>A <span><a href="7b2aeb27-92fc-41f6-8437-deb65d950921#gt_df3d0b61-56cd-4dac-9402-982f1fedc41c" data-linktype="relative-path">RID</a></span> representing an <span><a href="7b2aeb27-92fc-41f6-8437-deb65d950921#gt_8d10bd9d-392e-431b-8218-742bdac19815" data-linktype="relative-path">account</a></span>
to remove from the group&#39;s membership list.</p><p>This protocol asks the RPC runtime, via the <b>strict_context_handle</b>
attribute, to reject the use of context handles created by a method of a
different RPC interface than this one, as specified in <span><a href="../ms-rpce/290c38b1-92fe-4229-91e6-4fc376610c15" data-linktype="relative-path">[MS-RPCE]</a></span>
section <span><a href="../ms-rpce/38ae9f5a-dac2-46ad-b2b7-9c43f211d9f6" data-linktype="relative-path">3</a></span>.</p><p>Upon receiving this message, the server MUST process the
data from the message subject to the following constraints:</p><ol><li><p><span>    </span>The server MUST
return an error if <i>GroupHandle.HandleType</i> is not equal to
&#34;Group&#34;.</p>
</li><li><p><span>    </span><i>GroupHandle.GrantedAccess</i>
MUST have the required access specified in section <span><a href="87bacbd0-7b8b-429f-abc6-4b3d895d4e90" data-linktype="relative-path">3.1.2.2</a></span>. Otherwise,
the server MUST return STATUS_ACCESS_DENIED.</p>
</li><li><p><span>    </span>All database
operations MUST occur in a single transaction.</p>
</li><li><p><span>    </span>Let G be the
group referenced by the <i>GroupHandle.Object</i>.</p>
</li><li><p><span>    </span>Let TargetSid be
the <span><a href="7b2aeb27-92fc-41f6-8437-deb65d950921#gt_83f2020d-0804-4840-a5ac-e06439d50f8d" data-linktype="relative-path">SID</a></span>
composed by making the MemberId a suffix to the <span><a href="7b2aeb27-92fc-41f6-8437-deb65d950921#gt_9066e9dc-8275-4452-9073-daab5fd427c5" data-linktype="relative-path">domain prefix</a></span> of G&#39;s
objectSid.</p>
</li><li><p><span>    </span>If G&#39;s member
attribute does not have a <span><a href="7b2aeb27-92fc-41f6-8437-deb65d950921#gt_4d5e1f08-aa00-4dde-9411-7dd6e09ed85a" data-linktype="relative-path">dsname</a></span> value that
references the object whose <b>objectSid</b> is TargetSid, the server MUST
return an error.</p>
</li><li><p><span>    </span>G&#39;s member
attribute MUST be updated to remove a dsname value that references the object
with the <b>objectSid</b> value TargetSid.</p>
</li></ol></div>