Citrix, PowerShell, Script, Xenapp

Manage Citrix Xenapp using PowerShell

June 4, 2014

PowerShell is very powerful tool released by Microsoft. These cmdlets provide extra functionality not achievable from the GUI. With PowerShell you can automate most of things in your infrastructure. PowerShell is a command-line shell and scripting language to make administrator’s life easy.

PowerShell1024x768[1]

PowerShell commands are called cmdlets that let you manage your environment from command-line.

Citrix farms can be managed by PowerShell. In order to do that you need to install Xenapp PowerShell SDK.

For Citrix XenApp 5.0
https://www.citrix.com/English/ss/downloads/details.asp?downloadId=1687620&productId=186

For Citrix XenApp 6.0 and 6.5
https://www.citrix.com/downloads/xenapp/sdks/powershell-sdk.html

Citrix PowerShell SDK consists of three standard modules:
• Citrix XenApp Commands — The XenApp cmdlets provide a consistent command line and scripting experience for XenApp farm administrators to perform all aspects of XenApp farm management. The tasks that can be performed using these cmdlets range from the farm and server initialization after installation of XenApp farm servers to daily maintenance and monitoring of the farm objects. The cmdlets form a complete set of management functionality that all farm management tasks can be performed by using the cmdlets only. The XenApp Commands is a superset of the functionality provided through the traditional graphical user interface, the Citrix Delivery Services Console.
• Citrix Group Policy Provider — The Citrix Policy provider lets you examine, edit, clear, and copy policies and policy settings that are stored in any GPO. When the provider is loaded, it creates the LocalGpo and LocalFarmGpo drives to refer to the local Windows policy and any Citrix policy that is applied to the XenApp farm where the server is a member.
• Citrix Common Commands — The Citrix Common Commands provide functionality common to all Citrix products. The Common Commands are exposed through the snap-in: Citrix.Common.Commands.

In PowerShell commands and other items are packaged using modules and snap-ins. All cmdlets and providers in Windows PowerShell are delivered in snap-ins or modules, and modules can also contain functions, aliases, variables, and drives.

For Citrix you need to add Citrix snap-in to start using commands.

Add-PSSnapin Citrix.*

To list all Citrix commands use the below command.

Get-Command -Module Citrix.*

Using the Get-Help command followed by a command name will give you all the help information about that command. Get-Help with –full parameter to get details with examples.

Get-Help Get-XAApplicationReport

Piping can be used to pass result of one command to another.

Get-XAApplicationReport | Select-Object BrowserName

Get-Help and Get-command are very useful while working with PowerShell. You can get all required details about a command with this.

I hope this would be helpful to start with PowerShell scripting.

You Might Also Like

No Comments

Leave a Reply