PowerShell alone offers a plethora of options for Citrix administrators to automate common and complex administrative tasks. Time is valuable, performing common administrative tasks such as managing published applications with PowerShell will inevitably free up more time in the long run. The following provides a quick breakout on how to use PowerShell and the XenDesktop SDK Modules and common published application tasks.

First, we need to make sure the necessary PowerShell Modules are loaded appropriately.

  • Remote into one of the Desktop Broker Servers and launch PowerShell with administrative rights.
  • Assure script execution is set appropriately: Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Force
  • Next, load up the Citrix PowerShell modules with the following command: asnp citrix*

Next, lets leverage the XenDesktop SDK Modules and display information relative to how applications are published from within your XenDesktop 7.5 infrastructure.

  1. get-BrokerApplication –> retrive a list of applications that have been published.
  2. get-brokerapplication -enabled $true –> retrieve a list of applications that are enabled
  3. get-brokerapplication -enabled $false –> retrieve a list of applications that have been disabled
  4. rename-BrokerApplication –Name <existingAppName> -NewName <newAppName> –> rename a published application.
  5. remove-BrokerApplication –Name <existingAppName> -DesktopGroup <nameOfDesktopGroup> -AdminAddress <nameOfBrokerAddress> –> remove a published application.
  6. get-brokerapplication | select name,applicationtype,associateddesktopgroupuids,visible | format-list –> will enumerate a common set of application specific information an administrator would want to audit. a the following will be displayed back to the console; Application Name, Application Type, how many groups/users are associated with the application, and whether or not the application is visible.
  7. get-brokerapplication | select name,commandlineexecutable,commandlinearguments,enabled | export-csv c:tempapplictionAudit.csv –> will yield a quick listing of published applications, along with some of the important publishing specific parameters and export the results to a csv file for later review.

The above should be a good starting point for application management tasks. Randomly auditing the infrastructure and archiving published application lists will allow for administrators to quickly assess configuration drift and changes.