Managed Terminal Services::SendSessionMessage

The method sends the specified message to the specified Terminal Services session on the specified server. This may be used to notify users of server events (for example, reboot) that will affect their sessions. .

The method can send messages only to 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 and to which the message should be sent.

<sessionId>

Yes

Required input. The sessionId of the session to which the message should be sent. This should be a number in the range 0...65535 inclusive.

<message>

Yes

Required input. The text message to be sent.

<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="SendSessionMessage"> 
      <executeData> 
        <server>TheServer</server> 
        <sessionId>2</sessionId> 
        <message>Session ending. Please log off.</message> 
        <preferredDomainController>dc1</preferredDomainController> 
      </executeData> 
    </execute> 
  </procedure> 
</request> 

Applies To

Terminal Services Namespace

See also

Tasks

Managed Terminal Services::GetSessions
Managed Terminal Services::ControlSession