18.104.22.168.3 SamrDeleteUser (Opnum 35)
The SamrDeleteUser method removes a user object.
long SamrDeleteUser( [in, out] SAMPR_HANDLE* UserHandle );
UserHandle: An RPC context handle, as specified in section 22.214.171.124, representing a user object.
This protocol asks the RPC runtime, via the strict_context_handle attribute, to reject the use of context handles created by a method of a different RPC interface than this one, as specified in [MS-RPCE] section 3.
Upon receiving this message, the server MUST process the data from the message subject to the following constraints:
The server MUST return an error if UserHandle.HandleType is not equal to "User".
UserHandle.GrantedAccess MUST have the required access specified in section 126.96.36.199. Otherwise, the server MUST return STATUS_ACCESS_DENIED.
Let U be the object referenced by UserHandle.Object.
All database operations MUST occur in a single transaction.
If the RID of U's objectSid attribute value is less than 1000, an error MUST be returned.
In the DC configuration, if U is a parent to another object, an error MUST be returned.<51>
U MUST be removed from the database.
The server MUST delete the SamContextHandle ADM element (section 188.8.131.52) represented by UserHandle, and then MUST return 0 for the value of UserHandle and a return code of STATUS_SUCCESS.