Citrix XenApp 6 automation

If you’re looking for automation / unattended installation of Citrix XenApp 4.5 / 5 check here : XenApp 4.5 / 5 unattended installation

If you need to industrialize the installation of Citrix XenApp 6, you can follow this blog to create a new farm using command line and add a new XenApp server to an existing farm. On my side, I used the scripts you’ll read bellow with a deployment software (Altiris, SCCM etc…)

Unattended XenApp 6 farm creation

Before begging to install XenApp 6 you need to add one role and one feature to your Windows 2008 R2 server. To do so, you need to use PowerShell since servermanagercmd.exe reach his end of life.

Open a PowerShell shell and type Import-Module Servermanager to Load the Server Manager module into the Windows PowerShell session before working with Server Manager cmdlets. Once it’s done, you need to type this two command lines to add the .NET Framework 3.5.1 feature and the Remote Desktop Session Host role

Add-WindowsFeature AS-NET-Framework
Add-WindowsFeature RDS-RD-Server

You will need to reboot the computer before running the Citrix XenApp 6 unattended installation. To run an automated installation you will use the XenAppSetupConsole.exe tool on the DVD in the “XenApp Server Setup\bin” folder. This tool can be use with the following parameters :

Citrix Extensible Meta-Installer v1.1
 
Examples:
 
   XenAppSetupConsole.exe /install:XenApp /Platinum
   XenAppSetupConsole.exe /install:XenApp /Platinum /exclude:OfflinePlugin
   XenAppSetupConsole.exe /install:XenApp,WebInterface INSTALLDIR=C:\Citrix
 
Usage:
 
   /help                  Shows this help information. Alternatives: /h, /?
 
   /logfile:<path>        Specifies the path for the generated log file.
 
   /install:<item list>   Selects the components specified in the
                          comma-delimited list for install. Alternatives: /i
 
   /exclude:<item list>   Modifies the components provided with
                          /install:<...>, by deselecting any sub-features
                          specified in the comma-delimited list.
                          Alternatives: /x
 
Selecting product edition:
 
   /Platinum     Selects XenApp Platinum Edition.
 
   /Enterprise   Selects XenApp Enterprise Edition.
 
   /Advanced     Selects XenApp Advanced Edition.
 
   If no edition is specified, the default is /Platinum.
 
Install properties:
 
   ONLINE_PLUGIN_INSTALLDIR   Emplacement d'installation de Citrix Online
                              Plug-in.
 
   INSTALLDIR                 Emplacement d'installation de Citrix XenApp.
 
XenApp roles:
 
   PCMAdmin                      Administration de la Gestion de la capacit‚
                                 et de la consommation
 
   EdgeSightServer               EdgeSight Server
 
   WebInterface                  Interface Web
 
   MerchandisingServer           Merchandising Server
 
   Provisioning                  Provisioning Services
 
   SecureGateway                 Secure Gateway
 
   Licensing                     Serveur de licences
 
   SmartAuditorServer            Serveur SmartAuditor
 
   SsonService                   Service Single Sign-On
 
      XA_Console (default)       
 
   XenApp                        XenApp
 
      XA_Console (default)       
 
      XA_IISIntegration          
 
      EdgeSightAgentFeature      
 
      SmartAuditorAgentFeature   
 
      SSONAgentFeature           
 
      PCMAgentFeature            
 
      PVDeviceFeature

So, If you want to install XenApp 6 Enterprise Edition and create logs of this installation, just execute the following line where x:\ is either your DVD drive, a mapped drive or a share \\server\share\…

"x:\XenApp Server Setup\bin\XenAppSetupConsole.exe" /log:c:\XA6_install.log /Install:XenApp /Enterprise

The setup done and a reboot is required. The next step you will create a new Citrix XenApp 6 farm. You need to continue this configuration to create a dsn file where you’ll include the database name and the database server name. I used for this example a Microsoft SQL2008 SP3 server where I previously created the TEST_XA6 empty database.

The file sql.dsn :

[ODBC]
DRIVER=SQL Server
DATABASE=TEST_XA6
APP=Citrix IMA
UID=administrator
SERVER=SUOMIAPP01
Trusted_Connection=Yes

Save the sql.dsn file as a text file and you can either copy it before launching the configuration either leave it on a share and change the path in the next command line to use the correct path. To realize an unattended farm creation, we will use the XenAppConfigConsole.exe utility (you can find it in C:\Program Files (x86)\Citrix\XenApp\ServerConfig\ ) and here are the parameters you can use :

Citrix XenApp Server Configuration Tool [Version 1.1]
Copyright (c) 2010 Citrix Systems, Inc.  All rights reserved.
 
XenApp Config Options:
 
/NotStrict
/Confirm
/Pause
/Log:<log file>
/SqlExpressRootDir:<SQL Express Install Src Dir> (Default:..\SqlExpress_2008)
/ExecutionMode:[Create | Join | Leave | ImagePrep]
/FarmName:<Farm Name>
/CitrixAdministratorAccount:<Domain Name/User Name>
/SimpleDB
/ServerName:<Citrix Server>
/DsnFile:<Dsn File>
/AuthenticationType:[Windows | Sql] (Default:Windows)
/OdbcUserName:<The Odbc User Name>
/OdbcPassword:<The Odbc Password>
/LicenseServerName:<License Server Name>
/LicenseServerPort:<License Port> (Default:27000)
/ProhibitShadowing:[True | False] (Default:False)
/ProhibitRemoteControl:[True | False] (Default:False)
/ForceShadowPopup:[True | False] (Default:False)
/ForceShadowLogging:[True | False] (Default:False)
/SmartAuditorServerName:<Smart Auditor Server>
/ZoneName:<Zone Name> (Default:Default Zone)
/CustomXmlServicePort:<Port Number> (Default:80)
/AddAnonymousUsersToRemoteDesktopUserGroup:[True | False] (Default:True)
/AddUsersGroupToRemoteDesktopUserGroup:[True | False] (Default:True)
/AddAuthenticatedUsersToRemoteDesktopUserGroup:[True | False] (Default:False)
/AddLocalAdmin:[True | False] (Default:False)
/SkipXmlSetting:[True | False] (Default:False)
/SsoPluginUncPath:<Unc Path to Central Store> (Default:Use Active Directory)
/OnlinePluginServerUrl:<Url (or server name) to the PnAgent Server>
/PcmFarmName:<Power and Capacity Management Farm Name>
/PcmWorkloadName:<Power and Capacity Management Workload Name>
/EdgeSightCompanyName:<EdgeSight Company Name>
/EdgeSightServerName:<EdgeSight Server Name>
/EdgeSightServerPort:<EdgeSight Server Port> (Default:80)
/RemoveCurrentServer:[True | False] (Default:True)
/PrepMsmq:[True | False] (Default:True)
/RemoveAnonymousCitrixAccounts:[True | False] (Default:False)
 
Mapping old tool Parameters to XenApp Config Options:
 
FARM_SELECTION           /ExecutionMode:
NEW_FARM_NAME            /FarmName:
DOMAIN_NAME, USER_NAME   /CitrixAdministratorAccount:domain\user
SILENT_DSNFILE           /DsnFile:
ODBC_USER_NAME           /OdbcUserName:
ODBC_PASSWORD            /OdbcPassword:
LICENSE_SERVER_NAME      /LicenseServerName:
LICENSE_SERVER_PORT      /LicenseServerPort:
ZONE_NAME                /ZoneName:
XML_PORT_NUMBER          /CustomXmlServicePort:
XML_CHOICE
SHADOWING_CHOICE:Yes             /ProhibitShadowing:false
SHADOW_PROHIBIT_REMOTE_ICA       /ProhibitRemoteControl
SHADOW_PROHIBIT_NO_NOTIFICATION  /ForceShadowPopup
SHADOW_PROHIBIT_NO_LOGGING       /ForceShadowLogging
ADD_ANON_USERS                   /AddAnonymousUsersToRemoteDesktopUserGroup
CREATE_REMOTE_DESKTOP_USERS      /AddUsersGroupToRemoteDesktopUserGroup
 
Return Codes:
 
0 - Success
1 - Invalid Command-line options
2 - Unmatched Parameters
3 - Invalid Parameters
4 - Commit Failed

So I want to setup a new farm (XA6_TEST), add the local administrator as XenApp administrator, specify the license server address and port, specify the zone name,  add Users to the local Remote Desktop User Group, specify the dsn file location and name, the odbc username, odbc password and creation of a log file.

"C:\Program Files (x86)\Citrix\XenApp\ServerConfig\XenAppConfigConsole.exe" /ExecutionMode:Create /FarmName:XA6_TEST /CitrixAdministratorAccount:%computername%\administrator /AddLocalAdmin:True /LicenseServerName:192.168.0.99 /LicenseServerPort:27000 /ZoneName:Zone1 /AddUsersGroupToRemoteDesktopUserGroup:True /DsnFile:c:\sql.dsn /OdbcUsername:domain\User /odbcPassword:Password /log:c:\createfarm.log

Unattended XenApp 6 farm join

Now to add a server to the newly created XenApp 6 farm, proceed as follow, install Citrix XenApp 6 the same way as before by beginning to add feature and role :

Add-WindowsFeature AS-NET-Framework
Add-WindowsFeature RDS-RD-Server

and

"x:\XenApp Server Setup\bin\XenAppSetupConsole.exe" /log:c:\XA6_install.log /Install:XenApp /Enterprise

Reboot your server and use the following command line to join a farm (instead of creating)

“XenAppConfigConsole.exe" /ExecutionMode:Join /FarmName:TEST_XA6 /LicenseServerName:192.168.0.99 /LicenseServerPort:27000 /ZoneName:Zone1 /AddUsersGroupToRemoteDesktopUserGroup:True  /DsnFile:c:\sql.dsn /OdbcUsername:domaine\User /odbcPassword:Password /log:c:\joinfarm%1.log

This is it. With an deployment software like Altiris, SCCM etc, you can deploy as much XenApp 6 server as you want. If you wan to go further like I did before with the XenApp 4.5 / 5 unattended installation you can script the zone regarding the IP address etc etc…

Sources:
Citrix eDocs

Post author