Skip to content

List and end remote sessions from the command line#

Jump Desktop Connect's command line lists the remote sessions active on a host and disconnects them. Administrators, RMM and management tools, and connection brokers use these commands to see who is connected to a host and to end sessions without opening Connect's window, for example before reassigning a host, during maintenance, or when an account is disabled.

Applies to#

  • Hosts running Jump Desktop Connect 10.16 or later Alpha on Windows or macOS, or Jump Desktop Connect for Linux Alpha.
  • An administrator on the host: an elevated (Run as administrator) prompt on Windows, or sudo on macOS and Linux. Otherwise the commands refuse to run.
  • The Connect service must be running on the host.

Commands Alpha#

Run exactly one of these commands at a time. Add --json to any of them to print JSON instead of text, including for errors.

Command What it does
--sessions Lists the active remote sessions.
--disconnectsession <id> Disconnects the session with this session ID, as listed by --sessions.
--disconnectuser <name> Disconnects every session of this user. <name> is a Jump Desktop account email address (not case-sensitive), or a local user name on the host, which matches the user signed in to the session or the user whose desktop it shows.

Disconnecting is a request to the Connect service, which ends the sessions shortly after the command returns.

Run the commands#

Use JumpConnectCli.exe, the command-line version of Connect, located in the same folder as JumpConnect.exe (the ConnectPath value under HKEY_LOCAL_MACHINE\SOFTWARE\Jump Desktop\Connect\Shared). In an elevated 64-bit PowerShell:

$connect = (Get-ItemProperty "HKLM:\SOFTWARE\Jump Desktop\Connect\Shared").ConnectPath
$cli = Join-Path (Split-Path $connect) "JumpConnectCli.exe"
& $cli --sessions
& $cli --disconnectuser user@example.com
CONNECT="/Applications/Jump Desktop Connect.app/Contents/MacOS/JumpConnect"
sudo "$CONNECT" --sessions
sudo "$CONNECT" --disconnectsession <session-id>
sudo /usr/libexec/jump/jumpconnect --sessions
sudo /usr/libexec/jump/jumpconnect --disconnectsession <session-id>

Output#

As text, --sessions prints one line per session, or No active sessions.:

<session-id>  <viewer>  <viewer-ip>  <host-user>  <connection-type>  <duration>s

<viewer> is the viewer's Jump Desktop account email address, or the account name if there is no email address. A value that is not known is shown as -. The disconnect commands print Disconnect request sent for session <session-id> for each session.

With --json, --sessions prints a sessions array with an object for each session:

Field Value
sessionId The session ID, used with --disconnectsession.
startTime, startTimeUnixMs When the session started, as an ISO 8601 UTC time and as milliseconds since 1970.
durationSecs How long the session has been connected, in seconds.
authType How the session signed in: local (a local account on the host), interactive, anonymous, or none.
protocol The connection's protocol.
connectionType cloud (through the Jump cloud), direct (a direct connection, such as Cloudless Fluid), or null.
viewer The viewer's email, name, team, and ip. Email, name, and team are known only for connections through the Jump cloud.
osUser The local user the session signed in as on the host.
desktopSession The id and user of the host desktop session the viewer sees.

Fields with no value are null. With --json, the disconnect commands print {"disconnectRequested": [<session-id>, ...]}, and errors print {"error": {"code": "<code>", "message": "<message>"}}.

Exit codes#

Exit code Meaning Error code with --json
0 Success.
1 The Connect service could not be reached, for example because it is not running or is an older version, or another error. service_unreachable
2 Incorrect usage, such as a missing session ID or more than one command. invalid_request
3 Not run as an administrator or root. not_administrator
4 No session has that ID, or no session belongs to that user. session_not_found, no_matching_sessions