Share this page

# ctrx_get_server_name

Example | Information Retrieval Functions

Retrieves the name of the active server to which the client is connected.

Note: Supported only for legacy single-protocol Citrix scripts.

`int ctrx_get_server_name( LPSTR serverName, [CONTINUE_ON_ERROR,] CTRX_LAST );`

serverName | The output argument for the name of the server.
CTRX_LAST | A marker that indicates the end of the argument list.

ctrx_get_server_name retrieves the name of the server to which the client is connected.

The script must allocate memory space for the output buffer, serverName, before ctrx_get_server_name is invoked. Release the memory when it is no longer in use.

Note: This function is available only if the Citrix agent is installed. For details, see Citrix agent overview in the VuGen Help Center (select the relevant version). The agent is required because when working with a secured Citrix environment, such as Citrix Access Gateway, this function can only retrieve the server name from the Citrix agent. The agent must be installed and active in order to retrieve a valid name.

## Return Values

Citrix ICA Return Values

## Parameterization

Standard parameterization is not available for this function.

## Example

    char buf[100];
    ctrx_get_server_name( buf, CTRX_LAST );
    lr_output_message("current server name is %s", buf);

Tips to improve your search results... VuGen Function Reference Version 26.1 Function Reference 26.1 All View Local Help Center View Online Help Center Version: