<div class="content"><p align="right"><a href="https://msdn.microsoft.com/en-us/library/c3e9870a-0943-4d45-be94-edb9419a1c11" data-linktype="external">msdn link</a></p><p>The <b>NetrEnumerateTrustedDomainsEx</b> method SHOULD<a id="Appendix_A_Target_226"></a><a aria-label="Product behavior note 226" href="0c858a52-732a-43ec-85dd-e44b357c1898#Appendix_A_226" data-linktype="relative-path">&lt;226&gt;</a> return a list of <a href="b5e7d25a-40b2-41c8-9611-98f53358af66#gt_5ee032d0-d944-4acb-bbb5-b1cfc7df6db6" data-linktype="relative-path">trusted</a> <a href="b5e7d25a-40b2-41c8-9611-98f53358af66#gt_b0276eb2-4e65-4cf1-a718-e0920a614aca" data-linktype="relative-path">domains</a> from a specified
server. This method extends NetrEnumerateTrustedDomains by returning an array
of domains in a more flexible <a href="7de9866e-d3ef-4a9f-98a5-c2dcff1e61c1" data-linktype="relative-path">DS_DOMAIN_TRUSTSW</a>
structure, as specified in section 2.2.1.6.2, rather than the array of strings
in <a href="11743dc4-7a2d-4464-b351-50aeb8801b8b" data-linktype="relative-path">DOMAIN_NAME_BUFFER</a>
structure, as specified in section 2.2.1.6.1. The array is returned as part of
the <a href="251cf1be-2932-4d33-8532-595cf42e8091" data-linktype="relative-path">NETLOGON_TRUSTED_DOMAIN_ARRAY</a>
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 <a href="3b224201-b531-43e2-8c79-b61f6dea8640" data-linktype="relative-path">3.5.4.1</a>.</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>
  <p>0x0000051F</p>
  <p>ERROR_NO_LOGON_SERVERS</p>
  </td>
  <td>
  <p>There are currently no logon servers available to
  service the logon request.</p>
  </td>
 </tr><tr>
  <td>
  <p>0x000006FA</p>
  <p>ERROR_NO_TRUST_LSA_SECRET</p>
  </td>
  <td>
  <p>The workstation does not have a trust secret.</p>
  </td>
 </tr><tr>
  <td>
  <p>0x000006FB</p>
  <p>ERROR_NO_TRUST_SAM_ACCOUNT</p>
  </td>
  <td>
  <p>The security <a href="b5e7d25a-40b2-41c8-9611-98f53358af66#gt_00f35ba3-4dbb-4ff9-8e27-572a6aea1b15" data-linktype="relative-path">database</a> on the server
  does not have a computer account for this workstation trust relationship.</p>
  </td>
 </tr></tbody></table><dl>
<dd>
<p> </p>
</dd></dl><p>This method is a wrapper for <a href="f9823624-2b34-415c-bdca-9f9a6d97016b" data-linktype="relative-path">DsrEnumerateDomainTrusts</a>,
which strips off the F flag from the returned data for backward compatibility.
For details, see section 3.5.4.7.1.</p></div>