Skip to main content

Stop Session

Stops a Windows Remote Desktop Protocol (RDP) session by either disconnecting or logging off.

Common Properties

  • Name - The custom name of the node.
  • Color - The custom color of the node.
  • Delay Before (sec) - Waits in seconds before executing the node.
  • Delay After (sec) - Waits in seconds after executing node.
  • Continue On Error - Automation will continue regardless of any error. The default value is false.
info

If the ContinueOnError property is true, no error is caught when the project is executed, even if a Catch node is used.

Inputs

  • Session - The session object representing the RDP connection to stop.

Options

  • Action - The action to perform on the session. Default is "Disconnect".
    • Disconnect - Disconnects from the session but keeps it running on the remote computer
    • Log Off - Terminates the session completely on the remote computer

How It Works

The Stop Session node terminates a Windows Remote Desktop Protocol (RDP) session. When executed, the node:

  1. Validates the provided session object
  2. Based on the selected Action option:
    • Disconnect: Uses tscon command to disconnect from the session while keeping it active on the remote computer
    • Log Off: Uses logoff command to completely terminate the session on the remote computer

Requirements

  • A valid session object from a previously established RDP connection
  • Appropriate permissions to disconnect or log off sessions

Error Handling

The node will return specific errors in the following cases:

  • No session provided or session object is invalid
  • Session ID is missing from the session object
  • Failed to execute the disconnect or logoff command
  • Insufficient permissions to perform the requested action

Usage Notes

  • Disconnect is less disruptive as it preserves the session state on the remote computer
  • Log Off completely terminates the session, which may result in loss of unsaved work
  • After stopping a session, the session object is no longer valid for other operations
  • This node is typically used at the end of automation workflows to clean up RDP connections
  • The choice between Disconnect and Log Off depends on whether you want to preserve the session state