Automating XenApp 6.5 Part 2 of 4 - Citrix Worker Groups

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 worker groups 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 (explained in this article)
  • Citrix user and computer policies
  • Citrix load evaluators
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 worker groups using PowerShell

Worker groups only need to be created and not configured (except for adding servers of course). Only a single command line is needed to create a worker group (e.g. the worker group "Production"):

A worker group can contain:

  • Active Directory containers (OUs)
  • Active Directory server groups (security groups)
  • Farm servers

The following command line adds the OU "Test" to the worker group "Production":

To add a security group to the worker group "Production" use the following command line:

The following command line adds the current farm server to the worker group "Production":

In a fully automated environment it is my personal best-practice is to combine the creation of the worker group and adding an OU, security group or farm server in one script. I mean, why would you create the worker group and not any servers to it? You may as well do both things at the same time.

A professional (PowerShell) script needs more than a single line of code. In a professional script you need to:

  • Add comments (e.g. script name, author, date and purpose of the script);
  • Load the Citrix cmdlets;
  • Check if the worker group exist;
  • Create the worker group if it does not exist;
  • Add the OU, security group or server to the worker group;
  • Log actions and results.

Below follows an example of such as script.

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.

One thought on “Automating XenApp 6.5 Part 2 of 4 - Citrix Worker Groups

  1. Pingback: Automating XenApp 6.5 Part 1 of 4 - Citrix Administrators - Dennisspan.com

Leave a Reply

Your email address will not be published.

*