Citrix Studio PowerShell Syntax and Usage

Following topics will be grounds for discussion:

  • Studio vs PowerShell
  • Getting Started
  • Modules and Cmdlets
  • Getting Help
  • Location Documentation

Studio vs PowerShell

  • You can use both to manage XA/XD
  • Both tools can be used in a single deployment
  • Studio is Wizard based (although it does use PS in the background)
  • More Actions can be performed on the PS side and is used for advanced configuration and troubleshooting as well as PS based scripts for repetitive tasks.
  • Every action performed in Studio can be seen in Studio home -> PowerShell entry

Using Powershell

  • Start the powershell from server and import XA/XD PS SDK modules
    • „asnp citrix*”
  • Import specific XA/XD PS SDK and query after importet modules
    • „asnp Citrix.Broker.Admin.V2”
    • Get-Command -Module Citrix* | select ModuleName -Unique
  • In order to run a script, ensure that remote execution are allowed. Use help for examples and pointers
    • Get-Help Set-ExecutionPolicy

PowerShell SDK Modules

  • A module is comprised of the following 4 main components
    • Aliases
    • Cmdlets
    • Variables
    • Providers
  • XA/XD has about 17 modules, each dedicated to a specific set of functions

Cmdlet Syntax

  • Each module uses a cmdlet to run commands
  • Each cmdlet adhere to a syntax. See syntax form below

VERB

MODULE

NOUN

EXAMPLE

  • Any appended variables will be in respect to the last entered cmdlet (NOUN)

Basic Console Tasks performed in Studio and their powershell cmdlets

Listing Powershell cmdlets

  • Import cmdlets first
    • „asnp citrix*”
  • You can list imported modules by using
    • „get-command -module citrix* | select ModuleName -unique”

  • You can then use the output to query available commands for each cmdlet
    • „get-command -module Citrix.UserProfileManager.Admin.V1”

  • You can further get help on how to use a certain cmdlet by using
    • Get-Help New-UserProfileConfiguration
  • You can also get examples by appending „-examples” at the end of the above command
    • Get-Help New-UserProfileConfiguration -examples

  • You can also append variables like below to get everything from a get-help query
    • „- Detailed”
    • „- full”

Scripts