Automating XenApp 6.5 Part 4 of 4 - Citrix Load Evaluators

Did you ever want to fully automate your XenApp 6.5 farm? Did you manage an automated unattended installation or image, but  you are struggling to automate farm configurations? Would you like to learn how to create and configure load evaluators for XenApp 6.5 with PowerShell? In this case, this article is just for you.

Automating Citrix consists of various components. You need to configure:

  • Citrix administrators
  • Citrix worker groups
  • Citrix user and computer policies
  • Citrix load evaluators (explained in this article)
Note: see the article PowerShell Fundamentals if you are new to PowerShell or if you just want to refresh your memory. Especially important is the part about loading snap-ins and modules. Remember, the appropriate extensions need to be loaded before Citrix commands can be executed!

Creating and configuring Citrix load evaluators using PowerShell

Citrix installs two load evaluators by default: Default and Advanced. Additional custom load evaluators are easily created using PowerShell.

To give you an example. Let's create a custom load evaluator which sets the maximum CPU load to 90, the maximum RAM usage to 90 and the maximum number of concurrent user (server user load) to 50. This is the command:

And that's it! Life sometimes really is that simple. So what other values can we configure? Here is the complete list:

  • Application user load:
    Specify the maximum application user load and the application name to which this setting applies (e.g. -ApplicationUserLoad 20 -ApplicationBrowserName "Notepad").
  • Context Switches:
    Enter two values: one where there is considered to be no load and one specifying the maximum load (e.g. -ContextSwitches 900,16000).
  • CPU Utilization:
    Enter two values: one where there is considered to be no load and one specifying the maximum load (e.g.  -CpuUtilization 10,90).
  • Disk Data I/O:
    Enter two values: one where there is considered to be no load and one specifying the maximum load (e.g. -DiskDataIO 0,32767).
  • Disk Operations:
    Enter two values: one where there is considered to be no load and one specifying the maximum load (e.g. -DiskOperations 0,100).
  • IP Range:
    IP ranges can be allowed and denied. To enter an IP range and set it to "allow" use the following parameters: -IPRanges 192.168.0.10-192.168.0.100 -IPRangesAllowed $True. To deny the same range use: -IPRanges 192.168.0.10-192.168.0.100 -IPRangesAllowed $False.
  • Load Throttling:
    Manage the impact of logon on the load. Possible values are Extreme, High, MediumHigh, Medium,and MediumLow. The default value is High. Configure a different value like this: -LoadThrottling MediumHigh.
  • Memory Usage:
    Enter two values: one where there is considered to be no load and one specifying the maximum load (e.g.  -MemoryUsage 10,90).
  • Page Faults:
    Enter two values: one where there is considered to be no load and one specifying the maximum load (e.g.  -PageFaults 0,2000).
  • Page Swaps:
    Enter two values: one where there is considered to be no load and one specifying the maximum load (e.g. -PageSwaps 0,100).
  • Scheduling:
    Set a scheduling rule when logons to the servers are permitted. The parameter must be specified using the format StartTime-EndTime. The times are specified in the 24-hour format HH:MM. For every day in the week a separate parameter exists.
    For example, to allow logons from Monday to Friday from 8 o'clock in the morning until 6 o'clock in the evening enter -MondaySchedule  08:00-18:00 -TuesdaySchedule  08:00-18:00 -WednesdaySchedule  08:00-18:00 -ThursdaySchedule  08:00-18:00 -FridaySchedule  08:00-18:00. The two remaining parameters are: -SaturdaySchedule and -SundaySchedule.
  • Server User Load:
    Specify the maximum number of users which can be logged on to the Citrix server at the same time. For example: -ServerUserLoad 50.

Did you know that you can use the scheduling option to disable a Citrix server? What you do is you create a load evaluator and add the scheduling option. Then set the logon times of each day to zero, which means that there is no allowed logon window for users. This basically disables the server since users are not allowed to logon at any time.
Please be aware that this applies to the ICA protocol only! If standard users are allowed to connect to a Citrix server via RDP, which is not recommended, the new Citrix load evaluator will not prevent this.

The command for this is:

One other thing. The command New-XALoadEvaluator can only be used to create (and configure) a new load evaluator. To configure an existing load evaluator use the command Set-XALoadEvaluator.

The following script creates two load evaluators, "Enabled" and "Disabled". The "Enabled" load evaluator configures the CPU and RAM utilization and Load Throttling. The "Disabled" load evaluator does not allow any logon times.

When the script finishes you should see two additional load evaluators in the Citrix console:
Create and configure load evaluators for XenApp 6.5 with PowerShell: XenApp 6.5 console load evaluators

Related articles:

Share this post:
Dennis Span on EmailDennis Span on LinkedinDennis Span on Twitter
Dennis Span
Dennis Span
Dennis Span works as a Senior Citrix Architect for a large insurance company in Vienna, Austria. He holds multiple certifications such as CCE-V, CCIA and CCEA. In 2017, Dennis became a Citrix Technology Advocate (CTA). Besides his interest in virtualization technologies and blogging, he loves spending time with his family as well as snowboarding, playing basketball and rowing. He is fluent in Dutch, English, German and Slovak and speaks some Spanish.

Leave a Reply

Your email address will not be published.

*