<div class="content" name="NetrDfsRemoveFtRoot" uuid="a7cdf205-0348-4d51-9175-2427d8782828"><p>The NetrDfsRemoveFtRoot (Opnum 11) method removes the
specified root target from a <a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_2aad5e61-ffe9-406e-a192-328c5327ee72" data-linktype="relative-path">domainv1-based
DFS namespace</a>.<a id="Appendix_A_Target_112"></a><a aria-label="Product behavior note 112" href="3a466440-1ef6-4439-b4e2-be9eaddeb511#Appendix_A_112" data-linktype="relative-path">&lt;112&gt;</a> If the target is the last one
associated with the <a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_6a3f0be9-b9b4-49df-9d1c-a3b89e4e9890" data-linktype="relative-path">DFS
namespace</a>, then this method also deletes the DFS namespace. The DFS
namespace can be removed without first removing all of the links in it. </p><p>If a client tries to use this method on a <a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_8099f7c1-2a31-4a20-81e6-824689bd9c5a" data-linktype="relative-path">domainv2-based DFS namespace</a>
target, then the server MUST fail with the return value of ERROR_NOT_SUPPORTED.</p><p>The NetrDfsRemoveFtRoot method uses 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 NetrDfsRemoveFtRoot(
   [in, string] WCHAR* ServerName,
   [in, string] WCHAR* DcName,
   [in, string] WCHAR* RootShare,
   [in, string] WCHAR* FtDfsName,
   [in] DWORD ApiFlags,
   [in, out, unique] DFSM_ROOT_LIST** ppRootList
 );
</pre></div>
</dd></dl><p><b>ServerName: </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. This is the
host name <a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_ac90b498-3ba4-48d6-bcd6-5495f1654671" data-linktype="relative-path">DFS root target</a>
to be removed.</p><p><b>DcName: </b>The pointer to a null-terminated
Unicode string. For a domainv1-based DFS namespace, 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> to
be used by the DFS root targets being removed for getting or updating <a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_e8de88fd-d760-46fa-ad77-76961fa20aea" data-linktype="relative-path">DFS metadata</a> for the DFS
namespace. 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.</p><p><b>RootShare: </b>The pointer to a null-terminated
Unicode DFS root target <a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_3c179f10-1793-4268-96eb-de4d85a32060" data-linktype="relative-path">share
name</a> string. The <a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_a49a79ea-dac7-4016-9a84-cf87161db7e3" data-linktype="relative-path">share</a>
is not removed automatically when the method is successful; it MUST be removed
explicitly as needed.</p><p><b>FtDfsName: </b>The pointer to a null-terminated
Unicode string that contains the DFS namespace in which the operation is to be
performed. It MAY be different from the <i>RootShare</i>.</p><p><b>ApiFlags: </b>The only supported bit in the <i>ApiFlags</i>
parameter is DFS_FORCE_REMOVE.</p><dl>
<dd>
<table><thead>
  <tr>
   <th>
   <p>Value</p>
   </th>
   <th>
   <p>Meaning</p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>DFS_FORCE_REMOVE 0x80000000</td>
  <td>Removes the named DFS root target from the namespace&#39;s directory service metadata only.</td>
 </tr></tbody></table>
</dd>
<dd>
<p>All other bits are reserved and MUST NOT be used. If
reserved bits are specified, the server SHOULD<a id="Appendix_A_Target_113"></a><a aria-label="Product behavior note 113" href="3a466440-1ef6-4439-b4e2-be9eaddeb511#Appendix_A_113" data-linktype="relative-path">&lt;113&gt;</a> fail
the call.</p>
</dd></dl><p><b>ppRootList: </b>On success, returns a list of DFS
root targets in the <a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_133ab305-ad75-4b38-8ec9-40bc0dc3b594" data-linktype="relative-path">domain-based
DFS namespace</a> which the client will be responsible for notifying about the
change in the DFS namespace. See section <a href="049f29a4-5354-4984-a9ff-d08ae79b7cdb" data-linktype="relative-path">3.2.4.3.2</a>. The list MAY be
empty if the server has performed the notification.<a id="Appendix_A_Target_114"></a><a aria-label="Product behavior note 114" href="3a466440-1ef6-4439-b4e2-be9eaddeb511#Appendix_A_114" data-linktype="relative-path">&lt;114&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 root target was not found as a target of the specified DFS namespace.</td>
 </tr><tr>
  <td>0x00000005 ERROR_ACCESS_DENIED</td>
  <td>Permission to perform the operation was denied.</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 rootnamespace does not exist.</td>
 </tr></tbody></table>
</dd></dl><p>The server MUST verify the existence of the DFS namespace
that the <i>FtDfsName</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 root target
of the DFS namespace 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>The server MUST support deleting a DFS namespace without
first requiring removal of all the <a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_0611e93d-f0e7-42ee-a591-d77ebcbb6619" data-linktype="relative-path">DFS links</a> in it.</p><p>If the <i>DcName</i> parameter is not NULL, then it MUST be
the PDC for the domain of the DFS namespace.</p><p>The server MAY support DFS_FORCE_REMOVE on <a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_46c7db22-d5fb-431c-9d28-b2052d18ffda" data-linktype="relative-path">member servers</a>.<a id="Appendix_A_Target_115"></a><a aria-label="Product behavior note 115" href="3a466440-1ef6-4439-b4e2-be9eaddeb511#Appendix_A_115" data-linktype="relative-path">&lt;115&gt;</a> If it is not supported and
DFS_FORCE_REMOVE is specified, the server MUST return a failure.</p><p>If DFS_FORCE_REMOVE is not specified, the server MUST verify
it is the host specified by the <i>ServerName</i> and <i>RootShare</i>
parameters. If it is not, the server MUST return ERROR_NOT_FOUND.</p><p>If DFS_FORCE_REMOVE is not specified, the server SHOULD<a id="Appendix_A_Target_116"></a><a aria-label="Product behavior note 116" href="3a466440-1ef6-4439-b4e2-be9eaddeb511#Appendix_A_116" data-linktype="relative-path">&lt;116&gt;</a> also remove any local
information related to hosting the removed root target. If DFS_FORCE_REMOVE is
specified, the server MUST NOT do so.</p><p>The effect of DFS_FORCE_REMOVE is to clean up after the
named root target has become nonfunctional and is unable to remove itself from
the namespace.</p><p>The server MUST remove the root target of the domain-based
DFS namespace specified by the <i>ServerName</i> and <i>RootShare</i>
parameters by updating the <b>remoteServerName</b> attribute of the namespace&#39;s
<a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_8bb43a65-7a8c-4585-a7ed-23044772f8ca" data-linktype="relative-path">object</a> (as specified in
section <a href="aac9f417-7065-4e3d-9bd9-ab81822adfd4" data-linktype="relative-path">2.3.3</a>) in the
root target. If the last DFS root target is being removed, then the server
SHOULD NOT remove the object of the namespace; the client invoking the method
MUST do this.<a id="Appendix_A_Target_117"></a><a aria-label="Product behavior note 117" href="3a466440-1ef6-4439-b4e2-be9eaddeb511#Appendix_A_117" data-linktype="relative-path">&lt;117&gt;</a></p><p>The server SHOULD remove any intermediate directories and
reparse points that were part of the namespace.</p><p>The server MUST update the following fields in the
domainv1-based DFS metadata.</p><table><thead>
  <tr>
   <th>
   <p>Operation </p>
   </th>
   <th>
   <p>DFS metadata changes required </p>
   </th>
  </tr>
 </thead><tbody><tr>
  <td>Remove a namespace.</td>
  <td>Removes the object of DFS namespace.</td>
 </tr><tr>
  <td>Remove a root target.</td>
  <td>Updates the TargetCount in the existing DFSTargetListBLOB, removes the TargetEntryBLOB, updates the DFSTargetListBLOBSize, updates the BLOBDataSize of the DFSNamespaceRootBLOB, and removes the root target from the remoteServerName attribute in the object.</td>
 </tr></tbody></table><p>The server MUST synchronously update the DFS metadata of the
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, then 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="af9d607e-04e5-4722-8d00-76cf9c7b69f9" 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>