<div class="content"><p> </p><p>The NetrDfsRemoveFtRoot (Opnum 11) method removes the
specified root target from a <span><a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_2aad5e61-ffe9-406e-a192-328c5327ee72" data-linktype="relative-path">domainv1-based DFS namespace</a></span>.<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 <span><a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_6a3f0be9-b9b4-49df-9d1c-a3b89e4e9890" data-linktype="relative-path">DFS namespace</a></span>, 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 <span><a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_8099f7c1-2a31-4a20-81e6-824689bd9c5a" data-linktype="relative-path">domainv2-based
DFS namespace</a></span> target, then the server MUST fail with the return
value of ERROR_NOT_SUPPORTED.</p><p>The NetrDfsRemoveFtRoot method uses the following <span><a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_9c5903c1-1477-4181-b451-3ba1e34a0c0c" data-linktype="relative-path">MIDL</a></span>
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 <span><a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_c305d0ab-8b94-461a-bd76-13b40cb8c4d8" data-linktype="relative-path">Unicode</a></span>
string. This is the host name <span><a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_ac90b498-3ba4-48d6-bcd6-5495f1654671" data-linktype="relative-path">DFS root target</a></span> 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 <span><a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_76a05049-3531-4abd-aec8-30e19954b4bd" data-linktype="relative-path">DC</a></span> to be used by the
DFS root targets being removed for getting or updating <span><a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_e8de88fd-d760-46fa-ad77-76961fa20aea" data-linktype="relative-path">DFS
metadata</a></span> for the DFS namespace. This parameter MAY be a NULL
pointer; otherwise, it MUST be the <span><a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_663cb13a-8b75-477f-b6e1-bea8f2fba64d" data-linktype="relative-path">PDC</a></span> for the <span><a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_b0276eb2-4e65-4cf1-a718-e0920a614aca" data-linktype="relative-path">domain</a></span>
of the DFS namespace.</p><p><b>RootShare: </b>The pointer to a null-terminated
Unicode DFS root target <span><a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_3c179f10-1793-4268-96eb-de4d85a32060" data-linktype="relative-path">share name</a></span> string.
The <span><a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_a49a79ea-dac7-4016-9a84-cf87161db7e3" data-linktype="relative-path">share</a></span>
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>
  <p>DFS_FORCE_REMOVE</p>
  <p>0x80000000</p>
  </td>
  <td>
  <p>Removes the named DFS root target from the namespace&#39;s
  directory service metadata only.</p>
  </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 <span><a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_133ab305-ad75-4b38-8ec9-40bc0dc3b594" data-linktype="relative-path">domain-based DFS namespace</a></span>
which the client will be responsible for notifying about the change in the DFS
namespace. See section <span><a href="049f29a4-5354-4984-a9ff-d08ae79b7cdb" data-linktype="relative-path">3.2.4.3.2</a></span>. 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 <span><a href="../ms-erref/1bc92ddf-b79e-413c-bbaa-99a5281a6c90" data-linktype="relative-path">[MS-ERREF]</a></span>
section <span><a href="../ms-erref/18d8fbe8-a967-4f1c-ae50-99ca8e491d2d" data-linktype="relative-path">2.2</a></span>.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>
  <p>0x00000000</p>
  <p>ERROR_SUCCESS</p>
  </td>
  <td>
  <p>Successful completion.</p>
  </td>
 </tr><tr>
  <td>
  <p>0x00000002</p>
  <p>ERROR_FILE_NOT_FOUND</p>
  </td>
  <td>
  <p>The specified DFS root target was not found as a
  target of the specified DFS namespace.</p>
  </td>
 </tr><tr>
  <td>
  <p>0x00000005</p>
  <p>ERROR_ACCESS_DENIED</p>
  </td>
  <td>
  <p>Permission to perform the operation was denied.</p>
  </td>
 </tr><tr>
  <td>
  <p>0x00000057</p>
  <p>ERROR_INVALID_PARAMETER</p>
  </td>
  <td>
  <p>An incorrect parameter was specified.</p>
  </td>
 </tr><tr>
  <td>
  <p>0x00000490</p>
  <p>ERROR_NOT_FOUND</p>
  </td>
  <td>
  <p>The specified DFS rootnamespace does not exist.</p>
  </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 <span><a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_0611e93d-f0e7-42ee-a591-d77ebcbb6619" data-linktype="relative-path">DFS links</a></span> 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 <span><a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_46c7db22-d5fb-431c-9d28-b2052d18ffda" data-linktype="relative-path">member
servers</a></span>.<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
<span><a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_8bb43a65-7a8c-4585-a7ed-23044772f8ca" data-linktype="relative-path">object</a></span>
(as specified in section <span><a href="aac9f417-7065-4e3d-9bd9-ab81822adfd4" data-linktype="relative-path">2.3.3</a></span>) 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>
  <p>Remove a namespace.</p>
  </td>
  <td>
  <p>Removes the object of DFS namespace.</p>
  </td>
 </tr><tr>
  <td>
  <p>Remove a root target.</p>
  </td>
  <td>
  <p>Updates the <b>TargetCount</b> in the existing <span><a href="0e4aa671-ba82-4645-a259-94fe7b04086b" data-linktype="relative-path">DFSTargetListBLOB</a></span>,
  removes the <span><a href="c914cbbc-eb6f-4843-b344-f20dd0619853" data-linktype="relative-path">TargetEntryBLOB</a></span>,
  updates the DFSTargetListBLOBSize, updates the BLOBDataSize of the <span><a href="9f18db22-cfcc-429f-88eb-364a5ae7482c" data-linktype="relative-path">DFSNamespaceRootBLOB</a></span>,
  and removes the root target from the <b>remoteServerName</b> attribute in the
  object.</p>
  </td>
 </tr></tbody></table><p>The server MUST synchronously update the DFS metadata of the
namespace.</p><p>If <span><a href="a9bc4403-a862-48b9-b99b-1b44a887d177#gt_cf94d206-f71c-4ca1-891a-24c83f533e45" data-linktype="relative-path">DFS root scalability mode</a></span>
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 <span><a href="af9d607e-04e5-4722-8d00-76cf9c7b69f9" data-linktype="relative-path">DFS_INFO_101</a></span> 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>