Managed Terminal Services::ControlSession
The method logs off or disconnects the specified session on the specified server.
The method can control only interactive user sessions (those with sessions ID less than 65536).
Arguments
Input Arguments | Required | Description |
---|---|---|
<server> |
Yes |
Required input. The name of the server on which the specified session is running. |
<sessionId> |
Yes |
Required input. The sessionId of the session to be logged off or disconnected. This should be a number in the range 0..65535 inclusive. |
<action> |
Yes |
Required input. The action to be performed: "logoff" or "disconnect". |
<preferredDomainController> |
Yes |
Required input. The name of the preferred domain controller to be used to check the permissions of the caller. |
Remarks
Security
Permitted to DomainAdmins only
Sample Code
Example XML Request
<request>
<procedure>
<execute namespace="Managed Terminal Services"
procedure="ControlSession">
<executeData>
<server>TheServer</server>
<sessionId>2</sessionId>
<action>disconnect</action>
<preferredDomainController>dc1</preferredDomainController>
</executeData>
</execute>
</procedure>
</request>
Applies To
See also
Tasks
Managed Terminal Services::GetSessions
Managed Terminal Services::SendSessionMessage
Managed Terminal Services::ControlConnection
Managed Terminal Services::ControlServer
Managed Terminal Services::ControlRemoteDesktop