<div class="content"><p align="right"><a href="https://msdn.microsoft.com/en-us/library/ddd7452f-4b7d-47e6-895b-5b23d9dd2120" data-linktype="external">msdn link</a></p><p>The <b>NetrGetDCName</b> method MAY<a id="Appendix_A_Target_160"></a><a aria-label="Product behavior note 160" href="0c858a52-732a-43ec-85dd-e44b357c1898#Appendix_A_160" data-linktype="relative-path">&lt;160&gt;</a> be used to retrieve the <a href="b5e7d25a-40b2-41c8-9611-98f53358af66#gt_0334e0bd-2755-42f6-aeff-2d4a22bf4abf" data-linktype="relative-path">NetBIOS name</a> of the <a href="b5e7d25a-40b2-41c8-9611-98f53358af66#gt_663cb13a-8b75-477f-b6e1-bea8f2fba64d" data-linktype="relative-path">PDC</a> for the specified
domain. </p><dl>
<dd>
<div><pre> NET_API_STATUS NetrGetDCName(
   [in, string] LOGONSRV_HANDLE ServerName,
   [in, unique, string] wchar_t* DomainName,
   [out, string] wchar_t** Buffer
 );
</pre></div>
</dd></dl><p><b>ServerName: </b>The custom <a href="b5e7d25a-40b2-41c8-9611-98f53358af66#gt_44deb72d-c62b-4335-90e4-b9fd4dd782ed" data-linktype="relative-path">binding handle</a>, as defined
in section <a href="3b224201-b531-43e2-8c79-b61f6dea8640" data-linktype="relative-path">3.5.4.1</a>,
that represents the connection to a <a href="b5e7d25a-40b2-41c8-9611-98f53358af66#gt_76a05049-3531-4abd-aec8-30e19954b4bd" data-linktype="relative-path">domain controller</a>.</p><p><b>DomainName: </b>A null-terminated <a href="b5e7d25a-40b2-41c8-9611-98f53358af66#gt_c305d0ab-8b94-461a-bd76-13b40cb8c4d8" data-linktype="relative-path">Unicode</a> string that
specifies the NetBIOS name of the domain.</p><p><b>Buffer: </b>A pointer to a null-terminated Unicode
string that contains the NetBIOS name of the PDC for the specified domain. The
server name returned by this method is prefixed by two backslashes (\\).</p><p><b>Return Values: </b>The method returns 0x00000000
on success; otherwise, it MUST return a nonzero error code and SHOULD return
the following error code.</p><table><thead>
  <tr>
   <th>
   <p>Return Value/Code</p>
   </th>
   <th>
   <p>Description</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>
  <p>0x00000035</p>
  <p>ERROR_ BAD_ NETPATH</p>
  </td>
  <td>
  <p>The network path was not found.</p>
  </td>
 </tr></tbody></table><dl>
<dd>
<p> </p>
</dd>
<dd>
<p>If the <i>DomainName</i> parameter is not NULL and
is not a valid NetBIOS name format, the server MUST return NERR_DCNotFound (<a href="../ms-erref/1bc92ddf-b79e-413c-bbaa-99a5281a6c90" data-linktype="relative-path">[MS-ERREF]</a>
section <a href="../ms-erref/18d8fbe8-a967-4f1c-ae50-99ca8e491d2d" data-linktype="relative-path">2.2</a>).</p>
</dd></dl><p>The server MUST attempt to locate a PDC for the domain
specified by the client. The server MUST return NERR_DCNotFound if the PDC
could not be located for the specified domain. The server SHOULD<a id="Appendix_A_Target_161"></a><a aria-label="Product behavior note 161" href="0c858a52-732a-43ec-85dd-e44b357c1898#Appendix_A_161" data-linktype="relative-path">&lt;161&gt;</a> implement alternate means of
locating DCs: for example, a static list in a file, or two methods detailed in <a href="../ms-adts/d2435927-0999-4c62-8c6d-13ba31a52e1a" data-linktype="relative-path">[MS-ADTS]</a>
section <a href="../ms-adts/3e9711af-9067-435e-93fb-09182053cef7" data-linktype="relative-path">6.3.6</a>.</p><p>NetrGetDcName returns the name of the discovered PDC.</p></div>