<div class="content" name="NetrEnumerateTrustedDomainsEx" uuid="c3e9870a-0943-4d45-be94-edb9419a1c11"><p>The <b>NetrEnumerateTrustedDomainsEx</b> method SHOULD<a id="Appendix_A_Target_236"></a><a aria-label="Product behavior note 236" href="0c858a52-732a-43ec-85dd-e44b357c1898#Appendix_A_236" data-linktype="relative-path">&lt;236&gt;</a> return a list of <span><a href="b5e7d25a-40b2-41c8-9611-98f53358af66#gt_5ee032d0-d944-4acb-bbb5-b1cfc7df6db6" data-linktype="relative-path">trusted</a></span>
<span><a href="b5e7d25a-40b2-41c8-9611-98f53358af66#gt_b0276eb2-4e65-4cf1-a718-e0920a614aca" data-linktype="relative-path">domains</a></span>
from a specified server. This method extends NetrEnumerateTrustedDomains by
returning an array of domains in a more flexible <span><a href="7de9866e-d3ef-4a9f-98a5-c2dcff1e61c1" data-linktype="relative-path">DS_DOMAIN_TRUSTSW</a></span>
structure, as specified in section 2.2.1.6.2, rather than the array of strings
in <span><a href="11743dc4-7a2d-4464-b351-50aeb8801b8b" data-linktype="relative-path">DOMAIN_NAME_BUFFER</a></span>
structure, as specified in section 2.2.1.6.1. The array is returned as part of
the <span><a href="251cf1be-2932-4d33-8532-595cf42e8091" data-linktype="relative-path">NETLOGON_TRUSTED_DOMAIN_ARRAY</a></span>
structure, as specified in section 2.2.1.6.3. </p><dl>
<dd>
<div><pre> NET_API_STATUS NetrEnumerateTrustedDomainsEx(
   [in, unique, string] LOGONSRV_HANDLE ServerName,
   [out] PNETLOGON_TRUSTED_DOMAIN_ARRAY Domains
 );
</pre></div>
</dd></dl><p><b>ServerName: </b>The custom binding handle, as
defined in section <span><a href="3b224201-b531-43e2-8c79-b61f6dea8640" data-linktype="relative-path">3.5.4.1</a></span>.</p><p><b>Domains: </b>A pointer to a <b>NETLOGON_TRUSTED_DOMAIN_ARRAY</b>
structure, as specified in section 2.2.1.6.3, that contains an array of <b>DS_DOMAIN_TRUSTSW</b>
structures, as specified in section 2.2.1.6.2, one for each trusted domain.</p><p><b>Return Values: </b>The method returns 0x00000000
on success; otherwise, it SHOULD return one of the following error codes.</p><table><thead>
  <tr>
   <th>
   <p><span>Return Value/Code</span></p>
   </th>
   <th>
   <p>Description</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>0x0000051F ERROR_NO_LOGON_SERVERS</td>
  <td>There are currently no logon servers available to service the logon request.</td>
 </tr><tr>
  <td>0x000006FA ERROR_NO_TRUST_LSA_SECRET</td>
  <td>The workstation does not have a trust secret.</td>
 </tr><tr>
  <td>0x000006FB ERROR_NO_TRUST_SAM_ACCOUNT</td>
  <td>The security database on the server does not have a computer account for this workstation trust relationship.</td>
 </tr></tbody></table><dl>
<dd>
<p> </p>
</dd></dl><p>This method is a wrapper for <span><a href="f9823624-2b34-415c-bdca-9f9a6d97016b" data-linktype="relative-path">DsrEnumerateDomainTrusts</a></span>,
which strips off the F flag from the returned data for backward compatibility.
For details, see section 3.5.4.7.1.</p></div>