<div class="content" name="NetrDfsSetInfo2" uuid="d2d8d56c-7ff6-4674-8193-313ddf1f1c3b"><p>The NetrDfsSetInfo2 (Opnum 22) method sets or modifies the
information associated with a <a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_639b7503-b879-4ef7-98a8-14adf85bc16d" data-linktype="relative-path">DFS
root</a>, a <a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_ac90b498-3ba4-48d6-bcd6-5495f1654671" data-linktype="relative-path">DFS root target</a>,
a <a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_0611e93d-f0e7-42ee-a591-d77ebcbb6619" data-linktype="relative-path">DFS link</a>, or a <a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_44e2f830-c28b-41e3-8c3c-d0bb576ed9fb" data-linktype="relative-path">DFS link target</a>.</p><p>The NetrDfsSetInfo2 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 NetrDfsSetInfo2(
   [in, string] WCHAR* DfsEntryPath,
   [in, string] WCHAR* DcName,
   [in, unique, string] WCHAR* ServerName,
   [in, unique, string] WCHAR* ShareName,
   [in] DWORD Level,
   [in, switch_is(Level)] DFS_INFO_STRUCT* pDfsInfo,
   [in, out, unique] DFSM_ROOT_LIST** ppRootList
 );
</pre></div>
</dd></dl><p><b>DfsEntryPath: </b>The pointer to a DFS root path
or a DFS link path that contains the name of a DFS root or DFS link name.</p><p><b>DcName: </b>The pointer to a null-terminated <a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_c305d0ab-8b94-461a-bd76-13b40cb8c4d8" data-linktype="relative-path">Unicode</a> string. It MUST be
ignored for a <a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_701a2cc1-eb5a-400f-b394-5bad264ec8f6" data-linktype="relative-path">stand-alone
DFS namespace</a>. For a <a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_133ab305-ad75-4b38-8ec9-40bc0dc3b594" data-linktype="relative-path">domain-based
DFS namespace</a>, this string contains the host name of the <a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_76a05049-3531-4abd-aec8-30e19954b4bd" data-linktype="relative-path">DC</a> that the DFS root target
uses to get or update <a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_e8de88fd-d760-46fa-ad77-76961fa20aea" data-linktype="relative-path">DFS
metadata</a> for the <a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_6a3f0be9-b9b4-49df-9d1c-a3b89e4e9890" data-linktype="relative-path">DFS
namespace</a>. This parameter MAY be a NULL pointer; otherwise, it MUST be the <a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_663cb13a-8b75-477f-b6e1-bea8f2fba64d" data-linktype="relative-path">PDC</a> for the <a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_b0276eb2-4e65-4cf1-a718-e0920a614aca" data-linktype="relative-path">domain</a> of the DFS
namespace.<a id="Appendix_A_Target_99"></a><a aria-label="Product behavior note 99" href="3a466440-1ef6-4439-b4e2-be9eaddeb511#Appendix_A_99" data-linktype="relative-path">&lt;99&gt;</a></p><p><b>ServerName: </b>The pointer to a null-terminated
Unicode DFS root target or a DFS link target host name string. This parameter
MUST be a NULL pointer if the operation is intended for a DFS root or a DFS
link and not for targets.</p><p><b>ShareName: </b>The pointer to a null-terminated
Unicode DFS root target or a DFS link target <a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_3c179f10-1793-4268-96eb-de4d85a32060" data-linktype="relative-path">share name</a> string. This
parameter MUST be a NULL pointer if the operation is intended for a DFS root or
a DFS link and not for targets.</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_100 0x00000064</td>
  <td>Sets the comment associated with the root or link that specified in DfsInfo.</td>
 </tr><tr>
  <td>Level_101 0x00000065</td>
  <td>Sets the storage state associated with the root, link, root target, or link target specified in DfsInfo.&lt;100&gt;</td>
 </tr><tr>
  <td>Level_102 0x00000066</td>
  <td>Sets the time-out value associated with the root or link specified in DfsInfo.</td>
 </tr><tr>
  <td>Level_103 0x00000067</td>
  <td>Sets the property flags for the root or link specified in DfsInfo.</td>
 </tr><tr>
  <td>Level_104 0x00000068</td>
  <td>Sets the target priority rank and class for the root target or link target specified in DfsInfo.</td>
 </tr><tr>
  <td>Level_105 0x00000069</td>
  <td>Sets the comment, state, time-out information, and property flags for the root or link specified in DfsInfo. This does not apply to a root target or link target.</td>
 </tr><tr>
  <td>Level_106 0x0000006A</td>
  <td>Sets the target state and priority for the root target or link target specified in DfsInfo. This does not apply to the DFS namespace root or link.&lt;101&gt;</td>
 </tr><tr>
  <td>Level_107 0x0000006B</td>
  <td>Sets the comment, state, time-out, security descriptor information, and property flags for the root or link specified in DfsInfo. Does not apply to a root target or link target. The ServerName and ShareName parameters MUST be NULL. The security descriptor MUST NOT have an owner, group, or SACLs in it. The security descriptor MUST be a NULL, zero length value if used on a namespace root. In this case, note that it is equivalent to using Level_105.</td>
 </tr><tr>
  <td>Level_150 0x00000096</td>
  <td>Sets the security descriptor associated with a link. Only stand-alone DFS namespaces and domainv2-based DFS namespaces are supported. The ServerName and ShareName parameters MUST both be NULL. The security descriptor MUST NOT have an owner, group, or SACLs in it.</td>
 </tr></tbody></table>
</dd>
<dd>
<p>The server MUST support Level values 100 and 101.
The server SHOULD support Level values 102-107 and 150. If the server does not
support the provided Level, it MUST fail the call.<a id="Appendix_A_Target_102"></a><a aria-label="Product behavior note 102" href="3a466440-1ef6-4439-b4e2-be9eaddeb511#Appendix_A_102" data-linktype="relative-path">&lt;102&gt;</a> The server SHOULD return
error code ERROR_INVALID_PARAMETER for unsupported Level values.<a id="Appendix_A_Target_103"></a><a aria-label="Product behavior note 103" href="3a466440-1ef6-4439-b4e2-be9eaddeb511#Appendix_A_103" data-linktype="relative-path">&lt;103&gt;</a></p>
</dd></dl><p><b>pDfsInfo: </b>The pointer to a <a href="725240d3-2da7-41ef-8161-b7df1c2af497" data-linktype="relative-path">DFS_INFO_STRUCT</a> union that
contains the specified data. The <i>Level</i> parameter value determines the
case of the union.</p><p><b>ppRootList: </b>On success, returns a list of DFS
root targets in the domain-based DFS namespace which the client will be
responsible for notifying about the change in the DFS namespace. See section <a href="e01d2b11-8884-41cb-8a77-21b72e22307c" data-linktype="relative-path">3.2.4.2.3</a>. This list MAY
be empty if the server has performed the notification.<a id="Appendix_A_Target_104"></a><a aria-label="Product behavior note 104" href="3a466440-1ef6-4439-b4e2-be9eaddeb511#Appendix_A_104" data-linktype="relative-path">&lt;104&gt;</a></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>0x00000002 ERROR_FILE_NOT_FOUND</td>
  <td>The specified DFS link target was not found as a target of the specified DFS link.</td>
 </tr><tr>
  <td>0x00000005 ERROR_ACCESS_DENIED</td>
  <td>Permission to perform the operation was denied.</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, DFS link, or DFS link or root target does not exist.</td>
 </tr></tbody></table>
</dd></dl><p>The server MAY<a id="Appendix_A_Target_105"></a><a aria-label="Product behavior note 105" href="3a466440-1ef6-4439-b4e2-be9eaddeb511#Appendix_A_105" data-linktype="relative-path">&lt;105&gt;</a>
implement this method.</p><p>If the NetrDfsSetInfo (Opnum 3) method on a server does not
support a domain-based namespace, the server SHOULD support a domain-based
namespace in the NetrDfsSetInfo2 (Opnum 22) method.<a id="Appendix_A_Target_106"></a><a aria-label="Product behavior note 106" href="3a466440-1ef6-4439-b4e2-be9eaddeb511#Appendix_A_106" data-linktype="relative-path">&lt;106&gt;</a><a id="Appendix_A_Target_107"></a><a aria-label="Product behavior note 107" href="3a466440-1ef6-4439-b4e2-be9eaddeb511#Appendix_A_107" data-linktype="relative-path">&lt;107&gt;</a></p><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><p>The server MUST verify the existence of the DFS link target
of the DFS link that the <i>ServerName</i> and <i>RootShare</i> parameters
specify. If that existence check fails, the server MUST return
ERROR_FILE_NOT_FOUND.</p><p>If the <i>DcName</i> parameter is not NULL, it MUST be the
PDC for the domain of the domain-based DFS namespace.</p><p>The server MUST fail any attempt to set the state of a DFS
root, a DFS link, a DFS root target, or a DFS link target to a value that is
not specified. The server MUST fail any attempt to set the property flags on a
DFS link that are defined only for a DFS root.</p><p>With the <i>Level</i> parameter 101 and the <b>State</b>
field in the <a href="af9d607e-04e5-4722-8d00-76cf9c7b69f9" data-linktype="relative-path">DFS_INFO_101</a>
structure as DFS_VOLUME_STATE_RESYNCHRONIZE, the server MUST reload the
contents of the DFSMetadataCache, if maintained, for the domain-based DFS
namespace that the <i>ShareName</i> parameter specifies. In the case of both <a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_c37de1c8-4bd3-406f-ad8c-50c877666f91" data-linktype="relative-path">domain-based DFS namespaces</a>
and stand-alone DFS namespaces, the server MUST check the DFS namespace it
hosts locally with the DFS metadata and perform any required modifications.</p><p>With the <i>Level</i> parameter 101 and the <b>State</b>
field in the DFS_INFO_101 structure as DFS_VOLUME_STATE_FORCE_SYNC, the server
MUST perform a full synchronization instead of an incremental synchronization
to reload the contents of the DFSMetadataCache and to identify added or deleted
DFS links. This <b>State</b> field is supported on domainv2-based DFS
namespaces and stand-alone DFS namespaces.</p><p>When <i>level</i> parameter 107 is used for a DFS namespace
root or for a domainv1-based DFS link, the <i>pSecurityDescriptor</i> parameter
has no meaning because security descriptors cannot be associated with those
objects. In these cases, if pSecurityDescriptor is not NULL, the server MUST
fail with ERROR_NOT_SUPPORTED.</p><p>The server MUST update the same fields in the DFS metadata
for a <a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_2aad5e61-ffe9-406e-a192-328c5327ee72" data-linktype="relative-path">domain-basedv1 DFS
namespace</a> as for the NetrDfsSetInfo (Opnum 3) method, as specified in
section <a href="7b033d5b-8d26-4931-8b3d-7aa35e441fb0" data-linktype="relative-path">3.1.4.1.5</a>.</p><p>The server MUST synchronously update the DFS metadata of a
domain-based DFS namespace.</p><p>If <a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_cf94d206-f71c-4ca1-891a-24c83f533e45" data-linktype="relative-path">DFS
root scalability mode</a> is not enabled for the domain-based DFS namespace,
the server MUST do one of the following:</p><ul><li><p><span><span> 
</span></span>Notify other DFS root targets of the change in DFS metadata by
asynchronously issuing a NetrDfsSetInfo (Opnum 3) method with the <i>Level</i>
parameter 101 and with the <b>State</b> field of <a href="c76762de-1249-485e-8a30-b1ff37179a3d" data-linktype="relative-path">DFS_INFO_101</a> set to
DFS_VOLUME_STATE_RESYNCHRONIZE. The returned <i>ppRootList</i> parameter MUST
be empty.</p>
</li><li><p><span><span> 
</span></span>Perform no notification of the other root targets, returning a
list of DFS root targets to the client in the <i>ppRootList</i> parameter.</p>
</li></ul></div>