<div class="content"><p align="right"><a href="https://msdn.microsoft.com/en-us/library/1d6fad9e-763d-495f-9bed-18c79304c3d7" data-linktype="external">msdn link</a></p><p>The <b>NetrLogonGetTrustRid</b> method SHOULD<a id="Appendix_A_Target_231"></a><a aria-label="Product behavior note 231" href="0c858a52-732a-43ec-85dd-e44b357c1898#Appendix_A_231" data-linktype="relative-path">&lt;231&gt;</a> be used to obtain the <a href="b5e7d25a-40b2-41c8-9611-98f53358af66#gt_df3d0b61-56cd-4dac-9402-982f1fedc41c" data-linktype="relative-path">RID</a> of the account whose
password is used by <a href="b5e7d25a-40b2-41c8-9611-98f53358af66#gt_76a05049-3531-4abd-aec8-30e19954b4bd" data-linktype="relative-path">domain
controllers</a> in the specified domain for establishing the <a href="b5e7d25a-40b2-41c8-9611-98f53358af66#gt_08ce423c-9f9c-48ed-afa8-8b64c04ecdca" data-linktype="relative-path">secure channel</a> from the
server receiving this call. </p><dl>
<dd>
<div><pre> NET_API_STATUS NetrLogonGetTrustRid(
   [in, unique, string] LOGONSRV_HANDLE ServerName,
   [in, string, unique] wchar_t* DomainName,
   [out] ULONG * Rid
 );
</pre></div>
</dd></dl><p><b>ServerName: </b>The custom binding handle, as
defined in section <a href="3b224201-b531-43e2-8c79-b61f6dea8640" data-linktype="relative-path">3.5.4.1</a>.
</p><p><b>DomainName: </b>The null-terminated Unicode string
that contains the <a href="b5e7d25a-40b2-41c8-9611-98f53358af66#gt_604dcfcd-72f5-46e5-85c1-f3ce69956700" data-linktype="relative-path">DNS</a> or
<a href="b5e7d25a-40b2-41c8-9611-98f53358af66#gt_0334e0bd-2755-42f6-aeff-2d4a22bf4abf" data-linktype="relative-path">NetBIOS name</a> of the
primary or <a href="b5e7d25a-40b2-41c8-9611-98f53358af66#gt_5ee032d0-d944-4acb-bbb5-b1cfc7df6db6" data-linktype="relative-path">trusted</a>
domain. If this parameter is NULL, this method uses the name of the <a href="b5e7d25a-40b2-41c8-9611-98f53358af66#gt_387021de-3d6b-4372-835f-0d68c50cb496" data-linktype="relative-path">primary domain</a> of the
server.</p><p><b>Rid: </b>A pointer to an unsigned long that
receives the RID of the account.</p><p><b>Return Values: </b>The method returns 0x00000000
on success; otherwise, it returns a nonzero error code.</p><p>The server SHOULD<a id="Appendix_A_Target_232"></a><a aria-label="Product behavior note 232" href="0c858a52-732a-43ec-85dd-e44b357c1898#Appendix_A_232" data-linktype="relative-path">&lt;232&gt;</a> return
ERROR_ACCESS_DENIED if the caller is not local.</p><p>If <i>ServerName</i> equals NULL and <i>DomainName</i>
equals NULL, the server determines if the client has sufficient <a href="b5e7d25a-40b2-41c8-9611-98f53358af66#gt_d8092e10-b227-4b44-b015-511bb8178940" data-linktype="relative-path">privilege</a> (as specified in
section <a href="1ec94886-2b64-45af-b68e-3d9faa36617c" data-linktype="relative-path">3.5.4.2</a>) with
the Access Request mask set to NETLOGON_FTINFO_ACCESS.</p><p>Otherwise, the server determines if the client has
sufficient privilege (as specified in section 3.5.4.2) with the Access Request
mask set to NETLOGON_SERVICE_ACCESS.</p><p>If the client does not have sufficient privilege, the server
MUST return ERROR_ACCESS_DENIED.</p><p>If <i>ServerName</i> equals NULL, then the call MUST be made
to the local machine. If the <i>DomainName</i> is the same as the domain that
the machine is joined to, the call MUST succeed, and the server MUST return the
<b>AccountRid</b> of the machine in the domain. If the <i>DomainName</i> is a
different domain, the server MUST return ERROR_NO_SUCH_DOMAIN.</p><p>If both <i>ServerName</i> and <i>DomainName</i> are NULL,
the server MUST return the RID for the computer account of the caller.
Otherwise, the RID for the account identified by <i>ServerName</i> and <i>DomainName</i>
MUST be returned.</p><p>The server uses the server name passed in the <i>ServerName</i>
parameter to look up the domain for the request. If the name is not found, the
server MUST return ERROR_INVALID_COMPUTERNAME.</p><p>If the RID cannot be determined, the server SHOULD return
ERROR_TRUSTED_RELATIONSHIP_FAILURE.</p></div>