«

»

Mar 22

Citrix Xenapp 6.5 Powershell Guide

The arrival of new versions of XenApp led to a scramble in our habits of management with the disappearance of integrated features and handy far as Report Center.

Powershell took it and it is not necessarily easy to take control of these new management capabilities.

We will present you a short guide with examples for better understanding of the tools available.

To start run Powershell console of the XenApp server on which you are:

powershellVP

In state the console Powershell knows anything about XenApp commands.

Traditional tools work: qfarm , dsmaint , etc…

You must therefore mount a snappin in the command prompt to run the following commands:

–          Add-PSSnapin “Citrix.XenApp.Commands”

powershellVPaddpssnapin

 

 

 

 

 

 

 

 

 

The list of commands is available by executing the following command:

Get-Command -module “Citrix.XenApp.commands”

This module once installed will allow you to perform actions such as the Citrix console.

Ex : Get-XAFarm

powershellxafarm

So you can collect application data elements of the organization,farm informations ,interact with sessions, etc …

APPLICATIONS

To demonstrate the potential application we will present different commands.

In the list of available commands you can see the four following features:

Get-XAApplication (application properties without the users and servers)

Get-XAApplicationIcon (manage the application icon)

Get-XAApplicationParameter (management applications according to their type)

Get-XAApplicationReport (application properties with all details)

Running the Get-XAAplication returns a list of properties:

ApplicationType                        : ServerInstalled
PreLaunch                              : False
DisplayName                            : notepad_virtuaprod
ApplicationId                          : 402c-0006-000005b1
Description                            :
FolderPath                             : Applications/TEST
BrowserName                            : notepad_virtuaprod
Enabled                                : True
HideWhenDisabled                       : False
SequenceNumber                         : 1344008919
LoadBalancingApplicationCheckEnabled   : True
ContentAddress                         :
CommandLineExecutabe          : notepad.exe
WorkingDirectory                       :

… etc

All this informations is not necessarily those searched. So we will filter it by using Powershell redirector

Get-xapplication | ?{$_.FolderPath.StartsWith(“Applications/TEST”)}

We use ? which is actually an alias equivalent to Where-Object

Select all applications starting with Applications/TEST Folderpath properties.

FolderPath properties is your folder in the Citrix management console.

Get-xapplicationReport | select DisplayName,commandLineExecutable

The instruction ‘Select’ allow you to select the wanted field in the return of the command.

 

If you want convert the result of this command into CSV or HTML format by  | ConvertTo-Csv

In your select replace Accounts field or ServerNames by :

, @{name=’Accounts’; Expression={$_.Accounts}}   (comptes users)

,@{name=’ServerNames’; Expression={$_.ServerNames}} (machines)

We use this presentation for a correct return is generated when formatting CSV or HTML depending on the option chosen

You can now choose your fields to establish the desired reports

ORGANIZATION

You can get all information about your organization:

Ex :

– Farm Name : Get-XAFarm

– folders list : Get-XAFolder

– Server list : Get-XAServer

Ex : Get-XAServer | select ServerName

Get-XAServer give many informations : server IP , install path, setup date, citrix version, …

 

Powershell module can not only view but also create folders tree, workers groups, manage Citrix administrators and their rights, etc …

SESSIONS

You can also interact directly on the current sessions on the servers:

Get-XASession -ServerName MONSERVER | select SessionName,AccountName,State

SessionName  AccountName      State ICA-TCP#5   MONDOMAIN\moi Active

You will find that a lot of information is available and it is necessary to place very quickly filters through “| select”

The command set is very well documented with examples.

To have it go with :

Get-help MYCITRIXCOMMAND

Citrix PowerShell interface is very powerful and fast turns necessary to automate your tasks.

We hope have done a service by this little guide.

Feel free to comment for more informations.

 

Virtuaprod

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">