Partager via


3.1.5.4.5 SamrCreateUserInDomain (Opnum 12)

The SamrCreateUserInDomain method creates a user.

 long SamrCreateUserInDomain(
   [in] SAMPR_HANDLE DomainHandle,
   [in] PRPC_UNICODE_STRING Name,
   [in] unsigned long DesiredAccess,
   [out] SAMPR_HANDLE* UserHandle,
   [out] unsigned long* RelativeId
 );

DomainHandle: An RPC context handle, as specified in section 2.2.7.2, representing a domain object.

Name: The value to use as the name of the user. See the message processing shown later in this section for details on how this value maps to the data model.

DesiredAccess: The access requested on the UserHandle on output. See section 2.2.1.7 for a listing of possible values.

UserHandle: An RPC context handle, as specified in section 2.2.7.2.

RelativeId: The RID of the newly created user.

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.

The server MUST behave as with a call to SamrCreateUser2InDomain with the following parameter values.

Parameter name

Parameter value

DomainHandle

SamrCreateUserInDomain.DomainHandle

Name

SamrCreateUserInDomain.Name

AccountType

USER_NORMAL_ACCOUNT

DesiredAccess

SamrCreateUserInDomain.DesiredAccess

UserHandle

SamrCreateUserInDomain.UserHandle

RelativeId

SamrCreateUserInDomain.RelativeId