3.1.5.11.2 SamrLookupNamesInDomain (Opnum 17)
The SamrLookupNamesInDomain method translates a set of account names into a set of RIDs.
-
long SamrLookupNamesInDomain( [in] SAMPR_HANDLE DomainHandle, [in, range(0,1000)] unsigned long Count, [in, size_is(1000), length_is(Count)] RPC_UNICODE_STRING Names[*], [out] PSAMPR_ULONG_ARRAY RelativeIds, [out] PSAMPR_ULONG_ARRAY Use );
DomainHandle: An RPC context handle, as specified in section 2.2.7.2, representing a domain object.
Count: The number of elements in Names. The maximum value of 1,000 is chosen to limit the amount of memory that the client can force the server to allocate.
Names: An array of strings that are to be mapped to RIDs.
RelativeIds: An array of RIDs of accounts that correspond to the elements in Names.
Use: An array of SID_NAME_USE enumeration values that describe the type of account for each entry in RelativeIds.
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.
On receiving this message, the server MUST process the data from the message subject to the following constraints:
The server MUST return an error if DomainHandle.HandleType is not equal to "Domain".
DomainHandle.GrantedAccess MUST have the required access specified in section 3.1.2.2. Otherwise, the server MUST return STATUS_ACCESS_DENIED.
Let U be the set of all database objects whose objectSid's domain prefix matches the domain prefix of the domain referenced by DomainHandle.Object.
For each element in Names that matches a database object's sAMAccountName attribute value in the set U, the server MUST fill in RelativeIds and Use as follows:
Let 'i' be the current element of Names.
RelativeIds.Element[i] is the RID of the matched object's objectSid attribute value.
Use.Element[i] is set as follows.
objectClass
GroupType
Use
User
n/a
SidTypeUser
Group
GROUP_TYPE_ACCOUNT_GROUP
SidTypeGroup
Group
GROUP_TYPE_UNIVERSAL_GROUP
SidTypeGroup
Group
Any value not matching the above criteria for Group
SidTypeAlias
For each element in Names that does not match a database object's sAMAccountName attribute value in the set U, the server MUST fill in RelativeIds and Use as follows:
Let 'i' be the current element of Names.
RelativeIds.Element[i] is 0.
Use.Element[i] is SidTypeUnknown.
Otherwise:
RelativeIds.Count MUST be set to the input parameter Count on successful completion of the method.
Use.Count MUST be set to the input parameter Count on successful completion of the method.
If the number of matched accounts is equal to the input parameter Count, STATUS_SUCCESS MUST be returned.
If the number of matched accounts is less than the input parameter Count but greater than 0, STATUS_SOME_NOT_MAPPED MUST be returned. Note that this is not an error condition.
If the number of matched accounts is 0, STATUS_NONE_MAPPED MUST be returned.