Linux VDA package includes command line utilities to manage user sessions.
Following is the list of commands available to manage sessions from server and view user or session information.
This command displays information about users and sessions logged on to the server. Information displayed includes session id, client device name, client device IP address, session name and username.
Use -f option with short format options, to change the displayed information or -o option for long format options.
/usr/local/bin/ctxquery -f short_format_options | -o long_format_options [-m] [user_name]
/usr/local/bin/ctxquery -f idanu
The example above will display list of sessions connected to the server, with columns
session ID, Client device name, client device address, session name, user name.
ctxqsession, ctxqfull, ctxquser
All the above commands display session information like ctxquery but with pre-formatted output.
ctxqsession by default prints user name, session ID, state, type, and device.
ctxquser by default prints user name, session ID, session state, time the user has been idle for and the date and time the user logged on.
ctxqfull by default prints user name, session ID, session state, time the user has been idle for and the date and time the user logged on.
/usr/local/bin/ctxqfull user user_name
This command can be used to disconnect a session.
The session id can be obtained using command ctxquery (with flag i, in column SESSION: ID). Users can only disconnect their own sessions if they are not administrators. If session id is not provided, it will disconnect current session by default.
/usr/local/bin/ ctxdisconnect 1
This command will log off specific user’s session from a server.
If session id is not provided, it will log off current session by default. Be noted that the parameter can only be session id, not user name. User can only logoff session that belongs to it if it is not administrator.
This command reset an ICA session. Session id is mandatory.When a session is in bad status, this command can be used to clear dirty data and force log it off.
man <ctx_command> on the server for more information on these commands.
Citrix administrators can use these command line utilities to
- Query sessions on current server, “ctxquery –f iustd” and the output format would be session id, username, server name, session type and device.
- Using session Ids from ctxquery to quickly Logoff/disconnect/reset user’s sessions on the server.
- Use command line utilities to script admin jobs, like logoff all users.
Users can use these commands to
- Logoff current session from terminal.
- Reset your session.
Query current session details.