<div class="content" name="R_IISDisconnectUser" uuid="f3ce56ea-c6b2-4c5f-a0fe-eaa4576fb673"><p>The <b>R_IISDisconnectUser</b> method is called by the
client. In response, the server disconnects the specified user from the
specified <a href="ce912734-75c3-403c-8816-38e34e24df2f#gt_d9a0cf88-f6d7-4c52-a9fc-4ce5a7cb7260" data-linktype="relative-path">Internet protocol
server</a>.</p><dl>
<dd>
<div><pre> DWORD R_IISDisconnectUser(
   [in, string, unique] INET_INFO_IMPERSONATE_HANDLE pszServer,
   [in] DWORD dwServiceId,
   [in] DWORD dwInstance,
   [in] DWORD dwIdUser
 );
</pre></div>
</dd></dl><p><b>pszServer: </b>The custom binding handle for the
target system, as specified in section <a href="a6931aa0-3ab6-4018-a398-e142cb8e409e" data-linktype="relative-path">2.1.1</a>. The value MUST NOT
be used by the server implementation.</p><p><b>dwServiceId: </b>The identifier for the specified
Internet protocol server, as specified in section <a href="3e99d087-d9fd-46f8-a626-8656a4c58770" data-linktype="relative-path"><b>2.2.2</b></a>. </p><p><b>dwInstance: </b>The ID of the <a href="ce912734-75c3-403c-8816-38e34e24df2f#gt_1623705d-a7a0-4e46-9a66-66e9ee63d961" data-linktype="relative-path">Internet protocol server
instance</a> whose user is being disconnected.</p><p><b>dwIdUser: </b>The identifier of the user to
disconnect, as found in the <b>idUser</b> field of the <a href="d3bd5ad7-8d52-4b5a-a487-af0357e50090" data-linktype="relative-path"><b>IIS_USER_INFO_1</b></a>
structure returned by the <a href="0ac7906b-26f7-440e-bce4-79dabac3f0c3" data-linktype="relative-path"><b>R_IISEnumerateUsers</b></a>
method. A value of 0 for this parameter indicates that the server
implementation MUST attempt to disconnect all users from this Internet protocol
server instance.</p><p><b>Return Values: </b>The method returns 0
(ERROR_SUCCESS) to indicate success; otherwise, it returns a nonzero error
code, 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>
or[MS-ERREF] section <a href="../ms-erref/596a1078-e883-4972-9bbc-49e60bebca55" data-linktype="relative-path">2.3.1</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>0x00000002 ERROR_FILE_NOT_FOUND</td>
  <td>The system cannot find the specified file.</td>
 </tr><tr>
  <td>0x00000005 ERROR_ACCESS_DENIED</td>
  <td>Access is denied.</td>
 </tr><tr>
  <td>0x00000426 ERROR_SERVICE_NOT_ACTIVE</td>
  <td>The service is not running.</td>
 </tr><tr>
  <td>0x000008AD NERR_UserNotFound</td>
  <td>The user name could not be found.</td>
 </tr></tbody></table>
</dd></dl><p><b>Exceptions Thrown:</b> No exceptions are thrown
beyond those thrown by the underlying <a href="ce912734-75c3-403c-8816-38e34e24df2f#gt_8a7f6700-8311-45bc-af10-82e10accd331" data-linktype="relative-path">RPC</a> protocol, as specified
in <a href="../ms-rpce/290c38b1-92fe-4229-91e6-4fc376610c15" data-linktype="relative-path">[MS-RPCE]</a>.
</p><p>In response to this request from the client, the server MAY
disconnect a specific user if the <i>dwIdUser</i> value specifies that user and
SHOULD attempt to disconnect all users if <i>dwIdUser</i> is 0.<a id="Appendix_A_Target_16"></a><a aria-label="Product behavior note 16" href="29ba1825-00cc-45cb-8b68-4758993395cd#Appendix_A_16" data-linktype="relative-path">&lt;16&gt;</a></p></div>