Techibee.com

Powershell: How to get list of Citrix XenApp Servers publishing a given Application

Today I got a requirement to find out the list of Citrix XenApp Servers where a application is published. All I have is the name of the published application. Though I have been using powershell for a while now, I never tried it in Citrix environment. I took me some time to figure out the Add-Ins, modules required for querying the XenApp6 environment.  After familiarizing with XenApp powershell commands, I realized there is lot I can do with it in XenApp environment. And it is faster than GUI.

So, here is the script I am talking about which takes application name as parameter and displays the XenApp servers where it is published, Accounts that have access to it, path of the application, Type of the application(streamed/serverInstalled), Executable path and many more details.

Note that you need to download and install Citrix XenApp 6 Powershell SDK to get the required SnapIns. This is not required if you are running the script from a XenApp server since it already contains the required Powershell SDK installation.

function Get-CitrixPublishedApplicationDetails {
[cmdletbinding()]
param(
[string]$AppName
)            

Add-PsSnapIn Citrix*
Get-XAApplicationReport -BrowserName $AppName | Select DisplayName, ServerNames, Accounts, ApplicationType, ClientFolder, CommandlineExecutable            

}

Usage:

Get-CitrixPublishedApplicationDetails -AppName Notepad

Hope this helps…

[update]

There is another way available as well which returns the list of XenApp Servers on which a given application is hosted.

Get-XAServer -BrowserName Notepad | select ServerName

 

Exit mobile version