XenApp: Getting info about published Apps in a Farm using PowerShell


Purpose:

To find the name and folder location of applications published on a same farm in XenApp using PowerShell script.

Pre-requisite:

Following are the prerequisites for setting up the environment to execute PowerShell script to publish application in XenApp:

  1. .Net Framework 3.5 SP1 {Download it from Microsoft website}
  2. Microsoft PowerShell 1.0 {Download it from Microsoft website}
  3. XenApp Command technology preview{Download it from citrix site: https://www.citrix.com/English/ss/downloads/details.asp?downloadId=1687620&productId=186#top} : These commands are a PowerShell Tool Pack that allows managing most aspects related to XenApp.  They cover all of MFCOM functionality for features available in XenApp 5 and include functionality from both AMC and CMC.

Install all the above components in the given order onto the XenApp environment.

Solution: 

Below script is the solution. This script can be extended to get more information about the published application.

Script:

   1: # ============================================================

   2: # 

   3: # AUTHOR: Mohd Aslam

   4: # DATE  : 6/22/2010

   5: # 

   6: # COMMENT: This script will get the name and location of all the

   7: # applicatios published in XenApp under same farm.

   8: # 

   9: # ============================================================

  10:  

  11: $colItems = Get-XAApplication 

  12:  

  13: foreach ($objItem in $colItems) {

  14: $AppName = “Application Name: ” + $objItem.DisplayName 

  15: $AppName | Out-file "C:\temp\PS\AppReport.txt" -Append

  16: $AppFolder = “Folder Path: ” + $objItem.FolderPath 

  17: $AppFolder | Out-file "C:\temp\PS\AppReport.txt" -Append

  18: $gap = " "

  19: $gap | Out-file "C:\temp\PS\AppReport.txt" -Append

  20: }

How to Run above script?:

Save above script to some location with .ps1 extension. To Run above script, go to “Programs > Citrix > XenApp Commands” and click “Windows PowerShell with XenApp Commands (CTP2)” icon. It will launch PowerShell command prompt.

On the PowerShell command prompt, write script name with full location and click enter as: image    Result will be saved in a txt file “AppReport.txt”. Its content will be like:

Application Name: Excel

Folder Path: Applications/Office

Application Name: Desktop – ServerName

Folder Path: Applications/Desktops

Application Name: Notepad

Folder Path: Applications/Test
                                                                                  

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s