<div class="content" name="NetrDfsGetInfo" uuid="b5dd4568-3ea4-4f27-ae03-3ebb19fa4b13"><p>The NetrDfsGetInfo method returns information about a <a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_639b7503-b879-4ef7-98a8-14adf85bc16d" data-linktype="relative-path">DFS root</a> or a <a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_0611e93d-f0e7-42ee-a591-d77ebcbb6619" data-linktype="relative-path">DFS link</a> of the specified <a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_6a3f0be9-b9b4-49df-9d1c-a3b89e4e9890" data-linktype="relative-path">DFS namespace</a>. </p><p>The NetrDfsGetInfo method has the following <a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_9c5903c1-1477-4181-b451-3ba1e34a0c0c" data-linktype="relative-path">MIDL</a> syntax.</p><dl>
<dd>
<div><pre> NET_API_STATUS NetrDfsGetInfo(
   [in, string] WCHAR* DfsEntryPath,
   [in, unique, string] WCHAR* ServerName,
   [in, unique, string] WCHAR* ShareName,
   [in] DWORD Level,
   [out, switch_is(Level)] DFS_INFO_STRUCT* DfsInfo
 );
</pre></div>
</dd></dl><p><b>DfsEntryPath:</b> The pointer to a DFS root or a
DFS link path.</p><p><b>ServerName: </b>This parameter MUST be a NULL
pointer for Level_50 and MUST be ignored for other levels.</p><p><b>ShareName: </b>This parameter MUST be a NULL
pointer for Level_50 and MUST be ignored for other levels.</p><p><b>Level: </b>This parameter specifies the
information level of the data and, in turn, determines the action the method
performs. </p><dl>
<dd>
<table><thead>
  <tr>
   <th>
   <p>Value</p>
   </th>
   <th>
   <p>Meaning</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>Level_1 0x00000001</td>
  <td>Returns the name of the DFS root or the DFS link.</td>
 </tr><tr>
  <td>Level_2 0x00000002</td>
  <td>Returns the name, comment, state, and number of targets for the DFS root or the DFS link.</td>
 </tr><tr>
  <td>Level_3 0x00000003</td>
  <td>Returns the name, comment, state, number of targets, and target information for the DFS root or the DFS link.</td>
 </tr><tr>
  <td>Level_4 0x00000004</td>
  <td>Returns the name, comment, state, time-out, GUID, number of targets, and target information for the DFS root or the DFS link.</td>
 </tr><tr>
  <td>Level_5 0x00000005</td>
  <td>Returns the name, comment, state, time-out, GUID, property flags, metadata size, and number of targets for the DFS root or the DFS link.</td>
 </tr><tr>
  <td>Level_6 0x00000006</td>
  <td>Returns the name, comment, state, GUID, time-out, property flags, metadata size, number of targets, and target information for the DFS root or the DFS link.</td>
 </tr><tr>
  <td>Level_7 0x00000007</td>
  <td>Returns the version number GUID of the DFS metadata. This value only applies to the DFS root.</td>
 </tr><tr>
  <td>Level_8 0x00000008</td>
  <td>Returns the name, comment, state, time-out, GUID, property flags, metadata size, number of targets, and security descriptor associated with the DFS root or the DFS link. Only stand-alone DFS namespaces and domainv2-based DFS namespaces are supported.</td>
 </tr><tr>
  <td>Level_9 0x00000009</td>
  <td>Returns the name, comment, state, GUID, time-out, property flags, metadata size, number of targets, list of targets, and security descriptor for the DFS root or the DFS link. Only stand-alone DFS namespaces and domainv2-based DFS namespaces are supported.</td>
 </tr><tr>
  <td>Level_50 0x00000032</td>
  <td>Returns the DFS metadata version and capability information of an existing DFS namespace. This level is valid only for the DFS namespace root, not for DFS links. The ServerName and ShareName parameters MUST both be NULL.&lt;58&gt;</td>
 </tr><tr>
  <td>Level_100 0x00000064</td>
  <td>Returns the comment associated with the root or DFS link specified in the DfsEntryPath parameter.</td>
 </tr><tr>
  <td>Level_150 0x00000096</td>
  <td>Returns the security descriptor associated with a DFS link. Only stand-alone DFS namespaces and domainv2-based DFS namespaces are supported.</td>
 </tr></tbody></table>
</dd>
<dd>
<p>The server MUST support Level values 1-3 and 100.
The server SHOULD support Level values 4-9, 50 and 150. If the server does not
support the provided Level, it MUST fail the call.<a id="Appendix_A_Target_59"></a><a aria-label="Product behavior note 59" href="3a466440-1ef6-4439-b4e2-be9eaddeb511#Appendix_A_59" data-linktype="relative-path">&lt;59&gt;</a> The
server SHOULD return error code ERROR_INVALID_PARAMETER for unsupported Level
values.<a id="Appendix_A_Target_60"></a><a aria-label="Product behavior note 60" href="3a466440-1ef6-4439-b4e2-be9eaddeb511#Appendix_A_60" data-linktype="relative-path">&lt;60&gt;</a></p>
</dd></dl><p><b>DfsInfo: </b>The pointer to a <a href="725240d3-2da7-41ef-8161-b7df1c2af497" data-linktype="relative-path">DFS_INFO_STRUCT</a> union to
receive the returned information. The case of the union is selected by the
value of the <i>Level</i> parameter.</p><p><b>Return Values: </b>The method MUST return 0 on
success and a nonzero error code on failure. The method can return any specific
error code value, as specified in <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>.
The most common error codes are listed in the following table.</p><dl>
<dd>
<table><thead>
  <tr>
   <th>
   <p>Return value/code</p>
   </th>
   <th>
   <p>Description</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>0x00000000 ERROR_SUCCESS</td>
  <td>Successful completion.</td>
 </tr><tr>
  <td>0x00000032 ERROR_NOT_SUPPORTED</td>
  <td>The specified operation is not supported.</td>
 </tr><tr>
  <td>0x00000057 ERROR_INVALID_PARAMETER</td>
  <td>An incorrect parameter was specified.</td>
 </tr><tr>
  <td>0x00000490 ERROR_NOT_FOUND</td>
  <td>The specified DFS root or DFS link, or DFS link or root target does not exist.</td>
 </tr></tbody></table>
</dd></dl><p>The server MUST verify the existence of the DFS namespace
that the <i>DfsEntryPath</i> parameter specifies. If the namespace does not
exist, the server MUST return ERROR_NOT_FOUND.</p><p>The server MUST verify the existence of the DFS link that
the <i>DfsEntryPath</i> parameter specifies. If that existence check fails, the
server MUST return ERROR_NOT_FOUND.</p><table><thead>
  <tr>
   <th>
   <p>Value </p>
   </th>
   <th>
   <p>DFS metadata field </p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>1 (0x00000001)</td>
  <td>The Prefix field of NamespaceElement.</td>
 </tr><tr>
  <td>2 (0x00000002)</td>
  <td>In addition to those for Level 1: the Comment and State fields of NamespaceElement and the TargetCount field of TargetsList.</td>
 </tr><tr>
  <td>3 (0x00000003)</td>
  <td>In addition to those for Level 2: Target entries in the TargetsList.</td>
 </tr><tr>
  <td>4 (0x00000004)</td>
  <td>In addition to those for Level 3: the ReferralTTL and IdentityGUID fields of NamespaceElement.</td>
 </tr><tr>
  <td>5 (0x00000005)</td>
  <td>In addition to those for Level 4: the Properties field of NamespaceElement, and the size of the DFS namespace metadata,&lt;61&gt; but excluding Target entries.</td>
 </tr><tr>
  <td>6 (0x00000006)</td>
  <td>In addition to those for Level 5: Target entries in the TargetsList.</td>
 </tr><tr>
  <td>7 (0x00000007)</td>
  <td>The value of GenerationGUID attribute of the Namespace object.</td>
 </tr><tr>
  <td>8 (0x00000008)</td>
  <td>In addition to those for Level 5: SecurityDescriptor of the NamespaceElement.</td>
 </tr><tr>
  <td>9 (0x00000009)</td>
  <td>In addition to those for Level 6: SecurityDescriptor of the NamespaceElement.</td>
 </tr><tr>
  <td>50 (0x00000032)</td>
  <td>No metadata attribute stores this data. The value returned MUST, however, be one of the values defined in the table in section 2.2.3.10.</td>
 </tr><tr>
  <td>100 (0x00000064)</td>
  <td>Comment in NamespaceElement.</td>
 </tr><tr>
  <td>150 (0x00000096)</td>
  <td>SecurityDescriptor of the NamespaceElement.</td>
 </tr></tbody></table><p> For a standalone DFS namespace, the server MUST identify a
consistent GUID for the specified DFS link or DFS root path. This value MUST
conform to the expectations of <a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_c4813fc3-b2e5-4aa3-bde7-421d950d68d3" data-linktype="relative-path">UUID</a> uniqueness provided by
<a href="https://go.microsoft.com/fwlink/?LinkId=90460" data-linktype="external">[RFC4122]</a> or <a href="https://go.microsoft.com/fwlink/?LinkId=89824" data-linktype="external">[C706]</a>, though those
specific algorithms are not required. This GUID value MUST be used when
responding to calls specifying a <i>Level</i> parameter whose corresponding
return structure provides the GUID: values of 4, 5, 6, 8, or 9.</p><p>The server MUST use the following fields in the DFS metadata
for a stand-alone DFS namespace to return the required information, depending
on the value of the <i>Level</i> parameter.</p><p>The server MUST use the following fields in the DFS metadata
for a <a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_2aad5e61-ffe9-406e-a192-328c5327ee72" data-linktype="relative-path">domainv1-based DFS
namespace</a> to return the required information, depending on the value of the
<i>Level</i> parameter.</p><table><thead>
  <tr>
   <th>
   <p>Value </p>
   </th>
   <th>
   <p>DFS metadata field </p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>1 (0x00000001)</td>
  <td>The PrefixSize and Prefix fields of DFSRootOrLinkIDBLOB.</td>
 </tr><tr>
  <td>2 (0x00000002)</td>
  <td>In addition to those for Level 1: the CommentSize, Comment, and State fields of DFSRootOrLinkIDBLOB and the TargetCount field of DFSTargetListBLOB.</td>
 </tr><tr>
  <td>3 (0x00000003)</td>
  <td>In addition to those for Level 2: TargetEntryBLOB.</td>
 </tr><tr>
  <td>4 (0x00000004)</td>
  <td>In addition to those for Level 3: the ReferralTTL field of DFSNamespaceRootBLOB or DFSNamespaceLinkBLOB; the RootOrLinkGuid field of DFSRootOrLinkIDBLOB.</td>
 </tr><tr>
  <td>5 (0x00000005)</td>
  <td>In addition to those for Level 4: the RootOrLinkGuid field of DFSRootOrLinkIDBLOB, the Type field of DFSRootOrLinkIDBLOB, and the Size field of the value stored in the pKT attribute of the DFS namespace&#39;s object, but excluding TargetEntryBLOB.</td>
 </tr><tr>
  <td>6 (0x00000006)</td>
  <td>In addition to those for Level 5: TargetEntryBLOB.</td>
 </tr><tr>
  <td>7 (0x00000007)</td>
  <td>The Value of pKTGuid attribute of the DFS namespace&#39;s object.</td>
 </tr><tr>
  <td>50 (0x00000032)</td>
  <td>No metadata attribute stores this data. The value returned MUST, however, be one of the values defined in the table in section 2.2.3.10.</td>
 </tr><tr>
  <td>100 (0x00000064)</td>
  <td>CommentSize and Comment in DFSRootOrLinkIDBLOB, and BLOBDataSize of DFSNamespaceLinkBLOB.</td>
 </tr></tbody></table><p>Note that for interoperability, all root targets of a
namespace SHOULD use the same encoding for this <b>TargetTimestamp</b> field,
as specified in section 2.3.3.1.1.3.1.</p><p>The server MUST use the following fields in the DFS metadata
for a domainv2-based DFS namespace to return the required information,
depending on the value of the <i>Level</i> parameter.</p><table><thead>
  <tr>
   <th>
   <p>Value </p>
   </th>
   <th>
   <p>DFS metadata field </p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>1 (0x00000001)</td>
  <td>The msDFS-LinkPathv2 attribute.</td>
 </tr><tr>
  <td>2 (0x00000002)</td>
  <td>In addition to those for Level 1: msDFS-Commentv2, msDFS-Propertiesv2, and the TargetCount field of msDFS-TargetListv2.</td>
 </tr><tr>
  <td>3 (0x00000003)</td>
  <td>In addition to those for Level 2: msDFS-TargetListv2.</td>
 </tr><tr>
  <td>4 (0x00000004)</td>
  <td>In addition to those for Level 3: msDFS-Ttlv2, msDFS-NamespaceIdentityGUIDv2 for DFS root, and msDFS-LinkIdentityGUIDv2 for DFS link.</td>
 </tr><tr>
  <td>5 (0x00000005)</td>
  <td>In addition to those for Level 4: msDFS-Propertiesv2. Excludes msDFS-TargetListv2.</td>
 </tr><tr>
  <td>6 (0x00000006)</td>
  <td>In addition to those for Level 4: msDFS-Propertiesv2.</td>
 </tr><tr>
  <td>7 (0x00000007)</td>
  <td>The value of the msDFS-GenerationGUIDv2 attribute of the DFS namespace&#39;s object.</td>
 </tr><tr>
  <td>8 (0x00000008)</td>
  <td>In addition to those for Level 5: msDFS-LinkSecurityDescriptorv2.</td>
 </tr><tr>
  <td>9 (0x00000009)</td>
  <td>In addition to those for Level 6: msDFS-LinkSecurityDescriptorv2.</td>
 </tr><tr>
  <td>50 (0x00000032)</td>
  <td>The msDFS-SchemaMajorVersion and msDFS-SchemaMinorVersion attributes.</td>
 </tr><tr>
  <td>100 (0x00000064)</td>
  <td>The msDFS-Commentv2 attribute.</td>
 </tr><tr>
  <td>150 (0x00000096)</td>
  <td>The msDFS-LinkSecurityDescriptorv2 attribute.</td>
 </tr></tbody></table><p> </p></div>