How to add Citrix server name to the “On Failure” section of a scenario?

This can be a solution for users that need to pinpoint a Citrix server name by adding the server name in the notification error.
Using the Citrix Receiver for the On Failure scenario:
1. Create a new scenario and add a with a Variable Name (i.e. CTX_Server).  Add a Variable Value "No Connection Info"

How to add Citrix server name to the “On Failure” section of a scenario_ (360009441214)_image001


2. Add a Click On Image action of the Citrix Receiver icon located in your system taskbar.
3. Add a Click On Image action of by right click the Citrix Receiver icon and set Continue On Failure in properties.

How to add Citrix server name to the “On Failure” section of a scenario_ (360009441214)_image004


4. Add a Click On Image action of "Properties" button.  Set Continue On Failure in properties.n
5. Add a Click On Image action of (set it to Continue on Failure) and create a child action.

How to add Citrix server name to the “On Failure” section of a scenario_ (360009441214)_image007


6. Set the properties' Variable Name to CTX_Server (don't forget to set where the Text Area is located.
7. Add two Click On Image action for the OK and Close buttons, to close the windows open.
8. Lastly, Add an On Failure action and copy the two buttons on step number 6.              

How to add Citrix server name to the “On Failure” section of a scenario_ (360009441214)_image014

     
Finished Scenario

How to add Citrix server name to the “On Failure” section of a scenario_ (360009441214)_image012


A. Once the on failure scenario is finished, add this to your Citrix application scenario properties.
%CTX_Server% variable added to Failure Message of your scenario. 

How to add Citrix server name to the “On Failure” section of a scenario_ (360009441214)_image013

B. Add an On failure action action which will include your Play Script action scenario.

----------------------------------------------------------------------------------

The first step is to create a .cmd file with the command netstat -n | find "2598"

How to add Citrix server name to the “On Failure” section of a scenario_ (360009441214)_Screenshot_6



Save the file in the same folder you have the other cmd files that are used to launch your applications.
Once the file is created and saved, open the "get server name command" scenario in ScenarioBuilder.
Delete all the actions and add a "Run Command Line" action to it.
Open the properties of the "Run Command Line" action and have the Program/Command Line property be the directory of the cmd file you just created.
For example: C:\Users\admin\Desktop\getCTXsrv.cmd
Then add a Reg Expression: TCP #foreign#:

How to add Citrix server name to the “On Failure” section of a scenario_ (360009441214)_Screenshot_5


Save the changes.
Open the desired scenario (i.e. Epic_Prod) in ScenarioBuilder.
In "On Failure" section, make sure that the scenario being played is the "get server name command" scenario you just edited.
Finally, open the scenario properties;
Add the %foreign% to the Failure Message" property, and delete the variable %ServerName%.
Save the changes and send you updated scenario to the AppLoader Controller.