• Documenting a Citrix XenApp 6.5 Farm with Microsoft PowerShell

    October 7, 2011

    PowerShell, XenApp, XenApp 6.5

    A customer site I was at recently needed their new XenApp 6.0 farm documented. I remembered reading about Citrix having some PowerShell “stuff” for XenApp 6.0 so I started searching. I came across a short article by Michael Bogobowicz Getting a Farm Inventory With XenApp 6 PowerShell Scripting. That short article really piqued my interest. I took Michael’s little script as the starting point to learn Microsoft’s PowerShell. With some help from PowerShell MVP and fellow CTP Brandon Shell and a lot of help from Exchange MVP Michael B. Smith, I turned the original script into over 1800 lines of PowerShell to thoroughly document a XenApp 6 farm. For this article, I will update the original XenApp 6.0 documentation script for XenApp 6.5.

    NOTE: This script is continually updated.  You can always find the most current version by going to https://carlwebster.com/where-to-get-copies-of-the-documentation-scripts/

    This article will focus only on XenApp 6.5. There are already articles for XenApp 5 and XenApp 6.0 available on my web site.

    The prerequisites to follow along with this article are:

    • A server, physical or virtual, running Microsoft Windows Server 2008 R2 with or without SP1
    • Citrix XenApp 6.5 installed

    The nice thing about XenApp 6.5 compared to both XenApp 5 and XenApp 6 is that all the basic Citrix PowerShell stuff is installed when you install XenApp 6.5. But we still need the XenApp 6.5 PowerShell Help and the Citrix Group Policy PowerShell Commands.

    My initial goal was to see if I could walk down the nodes in the AppCenter (Figure 1) and see if I could document every nook and cranny.

    Figure 1
    Figure 1

    Before we can start using PowerShell to document anything in the XenApp 6.5 farm we first need to install the SDK (for the Help file) and Citrix Group Policy commands. From your XenApp 6.5 server, go to http://tinyurl.com/XenApp65PSSDK (Figure 2).

    Figure 2
    Figure 2

    Scroll down and click on Download XenApp 6.5 Powershell SDK — Version 6.5 (Figure 3). Do not exit your Internet browser at this time.

    Figure 3
    Figure 3

    Extract the file to C:\XA65SDK. Click Start, Run, type in C:\XA65SDK\XASDK6.5.exe, and press Enter (Figure 4).

    Figure 4
    Figure 4

    Click Run (Figure 5).

    Figure 5
    Figure 5

    Select I accept the terms of this license agreement and click Next (Figure 6).

    Figure 6
    Figure 6

    Select Update the execution policy (to AllSigned) and Click Next (Figure 7).

    Note: If you do not update the execution policy to AllSigned, the Citrix supplied XenApp PowerShell scripts will not load.

    Figure 7
    Figure 7

    Click Install (Figure 8).

    Figure 8
    Figure 8

    After a few seconds, the installation completes. Click Finish (Figure 9).

    Figure 9
    Figure 9

    Back in your Internet browser; go to http://tinyurl.com/XenApp6PSPolicies (Figure 10).

    Figure 10
    Figure 10

    Scroll down and click on Citrix.GroupPolicy.Commands.psm1 (Figure 11).

    Figure 11
    Figure 11

    Save the file in two different places:

    C:\Windows\System32\WindowsPowerShell\v1.0\Modules, in a new folder named Citrix.GroupPolicy.Commands (Figure 12)

    C:\Windows\SysWOW64\WindowsPowerShell\v1.0\Modules, in a new folder named Citrix.GroupPolicy.Commands (Figure 13)

    Figure 12
    Figure 12
    Figure 13
    Figure 13

    You can now close your Internet browser.

    Click Start, Administrative Tools, Windows PowerShell Modules.

    To prepare for processing the Citrix farm policies, type in import-module Citrix.GroupPolicy.Commands and press Enter.

    Everything is now set up for us to get started. Returning back to Michael Bogobowicz’s script, I didn’t need any of the e-mail stuff so I removed all that, which left the following:

    $farm = Get-XAFarm  #Gets the farm information
    $applications = Get-XAApplication  #Gets the published applications
    $servers = Get-XAServer  #Gets the XA servers in the farm
    
    #Prepares the output
    $output = "Farm: "+$farm.FarmName + "`n"
    $output += "`nServers `n"
    foreach($server in $servers){
       $output+=$server.ServerName + " ("+$server.CitrixEdition+" "+$server.CitrixVersion+")`n"
    }
    
    $output += "`nApplications `n"
    foreach($application in $applications){
       $output+=$application.DisplayName + " ("+$application.ApplicationType+")`n"
    }
    
    echo $output
    

    Pasting that into the PowerShell session, gave me what is shown in Figure 14.

    Figure 14
    Figure 14

    Next, I wanted to know all the information I could get. To get a listing of the available XenApp commands to enter the following command:

    Get-Command --Module Citrix* | Sort Noun, Verb | Select Name
    

    Typing that line into the PowerShell session returns a long list of Citrix PowerShell commands. A sample is shown in Figure 15.

    Figure 15
    Figure 15

    PowerShell commands are done in a Verb-Noun format. Get-Something, New-Something, Copy-Something, etc. I don’t want to change anything in my script, I just want to get, or retrieve, all the farm information possible. So how can I get a list of just the “Get” Citrix PowerShell commands, showing just the name, in alphabetical order? Being a good PowerShell citizen, Citrix puts “XA” or “Ctx” at the beginning of their Get commands.

    To get a list of the Get commands, showing just the Name, where the noun starts with “Ctx”, type the following in the PowerShell session (results are shown in Figure 16):

    Get-Command --Noun Ctx* -Verb Get | Select-Object Name
    
    Figure 16
    Figure 16
    Get-Command --Noun XA* -Verb Get | Select-Object Name
    
    Figure 17
    Figure 17

    Note: I figured out the commands I needed based on an e-mail from Brandon Shell and then typing help get-command –full. Looking at the examples in the help showed me the –Noun and –Verb parameters. My friend Michael B. Smith showed me how to retrieve just the Name column by using Select-Object Name. I did not have to sort the results as help told me that Get-Command returns the results in alphabetical order.

    Looking at Michael’s Bogobowicz’s script, I can see the pieces of information being returned.

    1. 1. The farm name
    2. 2. Each server’s name, product edition, and product version
    3. 3. Each application’s name and application type.

    Typing the commands into the PowerShell session gave me the results shown in Figure 18 and Figure 19.

    Figure 18
    Figure 18
    Figure 19
    Figure 19

    My next question was how do I find out what information each command returns for me to use? That information is contained in the SDK Help file. Click Start, All Programs, Citrix, XenApp 6.5 Server SDK, Citrix XenApp 6.5 Server SDK Help (Figure 20).

    Figure 20
    Figure 20

    The Citrix XenApp 6.5 Commands Reference help opens. Double-click XenApp Commands (Figure 21).

    Figure 21
    Figure 21

    Click on Get-XAServer (Figure 22).

    Figure 22
    Figure 22

    In the right pane, scroll down until you see the Return Type section (Figure 23).

    Figure 23
    Figure 23

    You see where the Return Type is a collection of XAServer objects. In the left pane, double-click XenApp Data Classes (Figure 24).

    Figure 24
    Figure 24

    Click on XAServer (Figure 25).

    Figure 25
    Figure 25

    In the right pane, you will see the information, or properties, returned by running Get-XAServer (Figure 26).

    Figure 26
    Figure 26

    These Properties are the same as what you see back in Figure 18.

    I used the same processes for finding and retrieving the information for all the nodes in the AppCenter.

    My goal is to use the same wording as what is seen in the AppCenter for headings, captions, and text. In order to do that, I needed a way to format the output text. At this point in my PowerShell learning, I did not know how to output objects. Michael B. Smith (MBS) developed a function for me to use called Line.

    Function line
    #function created by Michael B. Smith, Exchange MVP
    #@essentialexchange on Twitter
    #http://Essential.Exchange/blog
    {
    	Param( [int]$tabs = 0, [string]$name = ’’, [string]$value = ’’, [string]$newline = “`n”, [switch]$nonewline )
    
    	While( $tabs --gt 0 ) { $global:output += “`t”; $tabs--; }
    
    	If( $nonewline )
    	{
    		$global:output += $name + $value
    	}
    	Else
    	{
    		$global:output += $name + $value + $newline
    	}
    }
    

    Another lesson MBS taught me is to check to see if each cmdlet used returned an error and how to tell the cmdlet how I wanted to proceed if there was an error. This is done by using –ErrorAction, or –EA. ErrorAction has four values (Table 1):

    Table 1

    Enumeration Value Description
    SilentlyContinue 0 The Windows PowerShell runtime will continue processing without notifying the user that an action has occurred.
    Stop 1 The Windows PowerShell runtime will stop processing when an action occurs.
    Continue 2 The Windows PowerShell runtime will continue processing and notify the user that an action has occurred.
    Inquire 3 The Windows PowerShell runtime will stop processing and ask the user how it should proceed.

    For this documentation script, I always use 0. If an error occurs, I want the rest of the script to continue.

    Next, I needed to know how to test to see if an action, like Get-XAFarm, succeeded or had an error. MBS said to use $? to test if the most recent action succeeded (True) or had an error (False). For example:

    $farm = Get-XAFarm -EA 0
    
    If( $? )
    {
    	#success
    }
    Else
    {
    	#error
    }
    

    There are numerous differences between XenApp 6.5 and XenApp 5. For example:

    1. 1. Farm settings in XenApp 5 are now policy settings
    2. 2. Server specific settings in XenApp 5 are now policy settings
    3. 3. XenApp 6.5 uses Worker Groups
    4. 4. XenApp 6.5 uses Load Balancing Policies

    Because of these differences, to use PowerShell to document a XenApp farm requires a different script for each XenApp version. This also means each script needs to test to verify it is being run on the correct XenApp version.

    Let’s get started. We will build the script node by node.

    The beginning of the script:

    #Original Script created 8/17/2010 by Michael Bogobowicz, Citrix Systems.
    #To contact, please message @mcbogo on Twitter
    #This script is designed to be run on a XenApp 6 server
    
    #Modifications by Carl Webster, CTP and independent consultant
    #webster@carlwebster.com
    #@carlwebster on Twitter
    #http://www.CarlWebster.com
    #modified from the original script for XenApp 6.5
    #originally released to the Citrix community on October 7, 2011
    
    Function line
    #function created by Michael B. Smith, Exchange MVP
    #@essentialexchange on Twitter
    #http://TheEssentialExchange.com
    {
    	Param( [int]$tabs = 0, [string]$name = ’’, [string]$value = ’’, [string]$newline = “`n”, [switch]$nonewline )
    
    	While( $tabs --gt 0 ) { $global:output += “`t”; $tabs--; }
    
    	If( $nonewline )
    	{
    		$global:output += $name + $value
    	}
    	Else
    	{
    		$global:output += $name + $value + $newline
    	}
    }
    
    #Script begins
    $global:output = ""
    

    The first node in the AppCenter is the Farm itself and the first thing we need to check is to verify the script is being run under XenApp 6.5.

    # Get farm information
    $farm = Get-XAFarm -EA 0
    
    If( $? )
    {
    	#first check to make sure this is a XenApp 6.5 farm
    	If($Farm.ServerVersion.ToString().SubString(0,3) -eq "6.5")
    	{
    		#this is a XenApp 6.5 farm, script can proceed
    	}
    	Else
    	{
    		#this is not a XenApp 6.5 farm, script cannot proceed
    		write-warning "This script is designed for XenApp 6.5 and should not be run on previous versions of XenApp"
    		Return 1
    	}
    	line 0 "Farm: "$farm.FarmName
    }
    Else
    {
    	line 0 "Farm information could not be retrieved"
    }
    Write-Output $global:output
    $farm = $null
    $global:output = $null
    

    The next sub-node in Farm Properties is Configuration Logging (Figure 27).

    Figure 27
    Figure 27
    $global:ConfigLog = $False
    $ConfigurationLogging = Get-XAConfigurationLog -EA 0
    
    If( $? )
    {
    	If ($ConfigurationLogging.LoggingEnabled )
    	{
    		$global:ConfigLog = $True
    		line 0 ""
    		line 0 "Configuration Logging is enabled."
    		line 1 "Allow changes to the farm when logging database is disconnected: " $ConfigurationLogging.ChangesWhileDisconnectedAllowed
    		line 1 "Require administrator to enter credentials before clearing the log: " $ConfigurationLogging.CredentialsOnClearLogRequired
    		line 1 "Database type: " $ConfigurationLogging.DatabaseType
    		line 1 "Authentication mode: " $ConfigurationLogging.AuthenticationMode
    		line 1 "Connection string: "
    		$Tmp = "`t`t" + $ConfigurationLogging.ConnectionString.replace(";","`n`t`t`t")
    		line 1 $Tmp -NoNewline
    		line 0 ""
    		line 1 "User name: " $ConfigurationLogging.UserName
    		$Tmp = $null
    	}
    	Else
    	{
    		line 0 ""
    		line 0 "Configuration Logging is disabled."
    	}
    }
    Else
    {
    	line 0 "Configuration Logging could not be retrieved"
    }
    Write-Output $global:output
    $ConfigurationLogging = $null
    $global:output = $null
    

    Script output:

    Configuration Logging is enabled.
    
        Allow changes to the farm when logging database is disconnected: True
        Require administrator to enter credentials before clearing the log: True
        Database type: SqlServer
        Authentication mode: Integrated
        Connection string:
                Server=SQL
                Database=XA65ConfigLog
                Connection Timeout=20
                Packet Size=8192
                Encrypt=false
                Pooling=true
                Min Pool Size=0
                Max Pool Size=100
                Connection Lifetime=0
                Enlist=true
                Connection Reset=true
        User name: administrator
    

    The next node in the AppCenter is Administrators. Administrators can have Privileges and Permissions (Figure 28 and Figure 29).

    Figure 28
    Figure 28
    Figure 29
    Figure 29

    The Get-XAAdministrator cmdlet does not return all the information contained in the AppCenter. I created a custom administrator and set permissions in each of the folders. Only the Servers, Worker Groups, and Application folders were returned. We can only work with the data Citrix returns to us via PowerShell.

    I am sorting the output by the administrator’s name.

    $Administrators = Get-XAAdministrator -EA 0 | sort-object AdministratorName
    
    If( $? )
    {
    	line 0 ""
    	line 0 "Administrators:"
    	ForEach($Administrator in $Administrators)
    	{
    		line 0 ""
    		line 1 "Administrator name: "$Administrator.AdministratorName
    		line 1 "Administrator type: "$Administrator.AdministratorType -nonewline
    		line 0 " Administrator"
    		line 1 "Administrator account is " -NoNewLine
    		If($Administrator.Enabled)
    		{
    			line 0 "Enabled"
    		}
    		Else
    		{
    			line 0 "Disabled"
    		}
    		If ($Administrator.AdministratorType -eq "Custom")
    		{
    			line 1 "Farm Privileges:"
    			ForEach($farmprivilege in $Administrator.FarmPrivileges)
    			{
    				line 2 $farmprivilege
    			}
    
    			line 1 "Folder Privileges:"
    			ForEach($folderprivilege in $Administrator.FolderPrivileges)
    			{
    				$test = $folderprivilege.ToString()
    				$folderlabel = $test.substring(0, $test.IndexOf(":") + 1)
    				line 2 $folderlabel
    				$test1 = $test.substring($test.IndexOf(":") + 1)
    				$folderpermissions = $test1.replace(",","`n`t`t`t")
    				line 3 $folderpermissions
    			}
    		}
    
    	Write-Output $global:output
    	$global:output = $null
    	}
    }
    Else
    {
    	line 0 "Administrator information could not be retrieved"
    	Write-Output $global:output
    }
    
    $Administrators = $null
    $global:outout = $null
    

    Script output:

    Administrators:
    
        Administrator name: XENAPP65\Administrator
        Administrator type: Full Administrator
        Administrator account is Enabled
    
        Administrator name: XENAPP65\bshell
        Administrator type: ViewOnly Administrator
        Administrator account is Enabled
    
        Administrator name: XENAPP65\cwebster
        Administrator type: Custom Administrator
        Administrator account is Enabled
        Farm Privileges:
            EditFarmOther
            EditConfigurationLog
            EditZone
            ViewFarm
            LogOnWIConsole
            LogOnConsole
            ViewAdmins
            AssignLoadEvaluators
            EditLoadEvaluators
            ViewLoadEvaluators
            EditLoadBalancingPolicies
            ViewLoadBalancingPolicies
            ReplicatePrinterDrivers
            ViewPrinterDrivers
        Folder Privileges:
            Servers:
                 AssignApplicationsToServers
                 ViewSessions
                 ConnectSessions
                 SendMessages
                 LogOffSessions
                 DisconnectSessions
                 ResetSessions
                 ViewServers
                 EditOtherServerSettings
                 RemoveServer
                 TerminateProcess
            WorkerGroups:
                 ViewWorkerGroups
                 AssignApplicationsToWorkerGroups
            Applications:
                 ViewApplications
                 EditApplications
                 ViewSessions
                 ConnectSessions
                 SendMessages
                 LogOffSessions
                 DisconnectSessions
                 ResetSessions
                 TerminateProcessApplication
    

    The next node is the applications. Several items that made this node more of a challenge:

    1. Applications can be served by either Worker Groups or Servers
    2. Applications can be hosted on the XenApp server or Streamed
    3. File type associations
    4. Anonymous connections can be allowed

    Because applications can be in folders, I am sorting the output by folder name and then by the application’s display name.

    $Applications = Get-XAApplication -EA 0 | sort-object FolderPath, DisplayName
    
    If( $? -and $Applications)
    {
    	line 0 ""
    	line 0 "Applications:"
    	ForEach($Application in $Applications)
    	{
    		$AppServerInfoResults = $False
    		$AppServerInfo = Get-XAApplicationReport -BrowserName $Application.BrowserName -EA 0
    		If( $? )
    		{
    			$AppServerInfoResults = $True
    		}
    		$streamedapp = $False
    		If($Application.ApplicationType -Contains "streamedtoclient" -or $Application.ApplicationType -Contains "streamedtoserver")
    		{
    			$streamedapp = $True
    		}
    		#name properties
    		line 0 ""
    		line 1 "Display name: " $Application.DisplayName
    		line 2 "Application name (Browser name): " $Application.BrowserName
    		line 2 "Disable application: " -NoNewLine
    		If ($Application.Enabled)
    		{
    		 line 0 "False"
    		}
    		Else
    		{
    		 line 0 "True"
    		}
    		line 2 "Hide disabled application: " $Application.HideWhenDisabled
    		line 2 "Application description: " $Application.Description
    
    		#type properties
    		line 2 "Application Type: " $Application.ApplicationType
    		line 2 "Folder path: " $Application.FolderPath
    		line 2 "Content Address: " $Application.ContentAddress
    
    		#if a streamed app
    		If($streamedapp)
    		{
    			line 2 "Citrix streaming application profile address: " $Application.ProfileLocation
    			line 2 "Application to launch from the Citrix streaming application profile: " $Application.ProfileProgramName
    			line 2 "Extra command line parameters: " $Application.ProfileProgramArguments
    			#if streamed, Offline access properties
    			If($Application.OfflineAccessAllowed)
    			{
    				line 2 "Enable offline access: " $Application.OfflineAccessAllowed
    			}
    			If($Application.CachingOption)
    			{
    				line 2 "Cache preference: " $Application.CachingOption
    			}
    		}
    
    		#location properties
    		If(!$streamedapp)
    		{
    			line 2 "Command line: " $Application.CommandLineExecutable
    			line 2 "Working directory: " $Application.WorkingDirectory
    
    			#servers properties
    			If($AppServerInfoResults)
    			{
    				line 2 "Servers:"
    				ForEach($servername in $AppServerInfo.ServerNames)
    				{
    					line 3 $servername
    				}
    				line 2 "Workergroups:"
    				ForEach($workergroup in $AppServerInfo.WorkerGroupNames)
    				{
    					line 3 $workergroup
    				}
    			}
    			Else
    			{
    				line 3 "Unable to retrieve a list of Servers for this application"
    				line 3 "Unable to retrieve a list of Worker Groups for this application"
    			}
    		}
    
    		#users properties
    		If($Application.AnonymousConnectionsAllowed)
    		{
    			line 2 "Allow anonymous users: " $Application.AnonymousConnectionsAllowed
    		}
    		Else
    		{
    			If($AppServerInfoResults)
    			{
    				line 2 "Users:"
    				ForEach($user in $AppServerInfo.Accounts)
    				{
    					line 3 $user
    				}
    			}
    			Else
    			{
    				line 3 "Unable to retrieve a list of Users for this application"
    			}
    		}
    
    		#shortcut presentation properties
    		#application icon is ignored
    		line 2 "Client application folder: " $Application.ClientFolder
    		If($Application.AddToClientStartMenu)
    		{
    			line 2 "Add to client's start menu: " $Application.AddToClientStartMenu
    		}
    		If($Application.StartMenuFolder)
    		{
    			line 2 "Start menu folder: " $Application.StartMenuFolder
    		}
    		If($Application.AddToClientDesktop)
    		{
    			line 2 "Add shortcut to the client's desktop: " $Application.AddToClientDesktop
    		}
    
    		#access control properties
    		If($Application.ConnectionsThroughAccessGatewayAllowed)
    		{
    			line 2 "Allow connections made through AGAE: " $Application.ConnectionsThroughAccessGatewayAllowed
    		}
    		If($Application.OtherConnectionsAllowed)
    		{
    			line 2 "Any connection: " $Application.OtherConnectionsAllowed
    		}
    		If($Application.AccessSessionConditionsEnabled)
    		{
    			line 2 "Any connection that meets any of the following filters: " $Application.AccessSessionConditionsEnabled
    			line 2 "Access Gateway Filters:"
    			ForEach($filter in $Application.AccessSessionConditions)
    			{
    				line 3 $filter
    			}
    		}
    
    		#content redirection properties
    		If($AppServerInfoResults)
    		{
    			If($AppServerInfo.FileTypes)
    			{
    				line 2 "File type associations:"
    				ForEach($filetype in $AppServerInfo.FileTypes)
    				{
    					line 3 $filetype
    				}
    			}
    			Else
    			{
    				line 2 "No File Type Associations exist for this application"
    			}
    		}
    		Else
    		{
    			line 2 "Unable to retrieve the list of File Type Associations for this application"
    		}
    
    		#if streamed app, Alternate profiles
    		If($streamedapp)
    		{
    			If($Application.AlternateProfiles)
    			{
    				line 2 "Primary application profile location: " $Application.AlternateProfiles
    			}
    
    			#if streamed app, User privileges properties
    			If($Application.RunAsLeastPrivilegedUser)
    			{
    				line 2 "Run application as a least-privileged user account: " $Application.RunAsLeastPrivilegedUser
    			}
    		}
    
    		#limits properties
    		line 2 "Limit instances allowed to run in server farm: " -NoNewLine
    
    		If($Application.InstanceLimit -eq -1)
    		{
    			line 0 "No limit set"
    		}
    		Else
    		{
    			line 0 $Application.InstanceLimit
    		}
    
    		line 2 "Allow only one instance of application for each user: " -NoNewLine
    
    		If ($Application.MultipleInstancesPerUserAllowed)
    		{
    			line 0 "False"
    		}
    		Else
    		{
    			line 0 "True"
    		}
    
    		If($Application.CpuPriorityLevel)
    		{
    			line 2 "Application importance: " $Application.CpuPriorityLevel
    		}
    
    		#client options properties
    		If($Application.AudioRequired)
    		{
    			line 2 "Enable legacy audio: " $Application.AudioRequired
    		}
    		If($Application.AudioType)
    		{
    			line 2 "Minimum requirement: " $Application.AudioType
    		}
    		If($Application.SslConnectionEnable)
    		{
    			line 2 "Enable SSL and TLS protocols: " $Application.SslConnectionEnabled
    		}
    		If($Application.EncryptionLevel)
    		{
    			line 2 "Encryption: " $Application.EncryptionLevel
    		}
    		If($Application.EncryptionRequire)
    		{
    			line 2 "Minimum requirement: " $Application.EncryptionRequired
    		}
    
    		line 2 "Start this application without waiting for printers to be created: " -NoNewLine
    		If ($Application.WaitOnPrinterCreation)
    		{
    			line 0 "False"
    		}
    		Else
    		{
    			line 0 "True"
    		}
    
    		#appearance properties
    		If($Application.WindowType)
    		{
    			line 2 "Session window size: " $Application.WindowType
    		}
    		If($Application.ColorDepth)
    		{
    			line 2 "Maximum color quality: " $Application.ColorDepth
    		}
    		If($Application.TitleBarHidden)
    		{
    			line 2 "Hide application title bar: " $Application.TitleBarHidden
    		}
    		If($Application.MaximizedOnStartup)
    		{
    			line 2 "Maximize application at startup: " $Application.MaximizedOnStartup
    		}
    
    	Write-Output $global:output
    	$global:output = $null
    	$AppServerInfo = $null
    	}
    }
    Else
    {
    	line 0 "Application information could not be retrieved"
    }
    
    $Applications = $null
    $global:output = $null
    

    Script output:

    Applications:
    
        Display name: Notepad
            Application name (Browser name): Notepad
            Disable application: False
            Hide disabled application: False
            Application description:
            Application Type: ServerInstalled
            Folder path: Applications
            Content Address:
            Command line: c:\windows\system32\notepad.exe "%*"
            Working directory:
            Servers:
                XENAPP65
            Workergroups:
            Users:
                *CITRIX_BUILTIN*\*CITRIX_USERS*
            Client application folder:
            Allow connections made through AGAE: True
            Any connection: True
            File type associations:
                BATFILE
                CMDFILE
                WINDOWS.COMPOSITEFONT
                INFFILE
                INIFILE
                JSFILE
                JSEFILE
                TXTFILE
                MICROSOFT.POWERSHELLSCRIPT.1
                MICROSOFT.POWERSHELLDATA.1
                MICROSOFT.POWERSHELLMODULE.1
                REGFILE
                SCRIPTLETFILE
                CITRIX.OPTIMIZATIONSESSION
                VBEFILE
                VBSFILE
                WSFFILE
                WINDOWS.XAMLDOCUMENT
                WINDOWS.XBAP
            Limit instances allowed to run in server farm: No limit set
            Allow only one instance of application for each user: False
            Application importance: Normal
            Minimum requirement: None
            Encryption: Basic
            Start this application without waiting for printers to be created: True
            Session window size: 1024x768
            Maximum color quality: Colors32Bit
    
        Display name: Paint
            Application name (Browser name): Paint
            Disable application: False
            Hide disabled application: False
            Application description:
            Application Type: ServerInstalled
            Folder path: Applications
            Content Address:
            Command line: c:\windows\system32\mspaint.exe "%*"
            Working directory:
            Servers:
            Workergroups:
                XenApp 6.5 Server
            Users:
                XENAPP65\Administrator
                XENAPP65\bshell
                XENAPP65\cwebster
            Client application folder:
            Allow connections made through AGAE: True
            Any connection: True
            File type associations:
                PAINT.PICTURE
                EMFFILE
                RLEFILE
                WMFFILE
            Limit instances allowed to run in server farm: 1
            Allow only one instance of application for each user: True
            Application importance: Low
            Minimum requirement: Basic
            Encryption: Bits56
            Start this application without waiting for printers to be created: True
            Session window size: 1024x768
            Maximum color quality: Colors32Bit
    

    I didn’t have any streamed applications in my lab but a couple of friends who helped test this script did and the streaming information was displayed.

    Next up is the History node which is actually the Configuration Logging report.

    If you use Configuration Logging, you will need to use a UDL file in order for the History section of the script to work. For an explanation, see http://tinyurl.com/CreateUDLFile.

    The UDL file will need to be placed in the same folder as the XA65_Inventory.ps1 script. The UDL file will need to be named XA65ConfigLog.udl. You will need to edit the UDL file and add ;Password=ConfigLogDatabasePassword to the end of the last line in the file. For example, here is mine (the line is one line):

    Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;User ID=administrator;Initial Catalog=XA65ConfigLog;Data Source=SQL;Password=abcd1234

    If( $Global:ConfigLog )
    {
    	#history AKA Configuration Logging report
    	#only process if $Global:ConfigLog = $True and .\XA65ConfigLog.udl file exists
    	#build connection string
    	#User ID is account that has access permission for the configuration logging database
    	#Initial Catalog is the name of the Configuration Logging SQL Database
    	If ( Test-Path .\XA65ConfigLog.udl )
    	{
    		$ConnectionString = Get-Content .\xa65configlog.udl | select-object -last 1
    		$ConfigLogReport = get-CtxConfigurationLogReport -connectionstring $ConnectionString -EA 0
    
    		If( $? -and $ConfigLogReport)
    		{
    			line 0 ""
    			line 0 "History:"
    			ForEach($ConfigLogItem in $ConfigLogReport)
    			{
    				line 0 ""
    				Line 1 "Date: " $ConfigLogItem.Date
    				Line 1 "Account: " $ConfigLogItem.Account
    				Line 1 "Change description: " $ConfigLogItem.Description
    				Line 1 "Type of change: " $ConfigLogItem.TaskType
    				Line 1 "Type of item: " $ConfigLogItem.ItemType
    				Line 1 "Name of item: " $ConfigLogItem.ItemName
    			}
    			Write-Output $global:output
    			$global:output = $null
    		}
    		Else
    		{
    			line 0 "History information could not be retrieved"
    		}
    		Write-Output $global:output
    		$ConnectionString = $null
    		$ConfigLogReport = $null
    		$global:output = $null
    	}
    	Else
    	{
    		line 0 "XA65ConfigLog.udl file was not found"
    	}
    }
    

    Script output:

    History:
    
        Date: 10/03/2011 09:07:33
        Account: XENAPP65\Administrator
        Change description: Settings for Configuration Logging were initialized.
        Type of change: Modified
        Type of item: Farm
        Name of item: XA65Farm
    
        Date: 10/03/2011 09:11:16
        Account: XENAPP65\Administrator
        Change description: Administrator XENAPP65\bshell was added.
        Type of change: Created
        Type of item: User
        Name of item: XENAPP65\bshell
    
        Date: 10/03/2011 09:11:52
        Account: XENAPP65\Administrator
        Change description: Administrator XENAPP65\cwebster was added.
        Type of change: Created
        Type of item: User
        Name of item: XENAPP65\cwebster
    
        Date: 10/03/2011 09:12:58
        Account: XENAPP65\Administrator
        Change description: Application Notepad was published.
        Type of change: Created
        Type of item: Application
        Name of item: Notepad
    
        Date: 10/03/2011 09:13:22
        Account: XENAPP65\Administrator
        Change description: 160042
        Type of change: Created
        Type of item: 21
        Name of item: XenApp 6.5 Server
    
        Date: 10/03/2011 09:14:24
        Account: XENAPP65\Administrator
        Change description: Application Paint was published.
        Type of change: Created
        Type of item: Application
        Name of item: Paint
    
        Date: 10/03/2011 09:15:50
        Account: XENAPP65\Administrator
        Change description: Policy Sample for Script was modified.
        Type of change: Modified
        Type of item: Policy
        Name of item: Sample for Script
    
        Date: 10/03/2011 09:15:50
        Account: XENAPP65\Administrator
        Change description: Policy Sample for Script was added.
        Type of change: Created
        Type of item: Policy
        Name of item: Sample for Script
    
        Date: 10/03/2011 09:16:34
        Account: XENAPP65\Administrator
        Change description: Policy Sample for Script was modified.
        Type of change: Modified
        Type of item: Policy
        Name of item: Sample for Script
    
        Date: 10/03/2011 09:16:45
        Account: XENAPP65\Administrator
        Change description: Policy Sample for Script was modified.
        Type of change: Modified
        Type of item: Policy
        Name of item: Sample for Script
    
        Date: 10/03/2011 17:12:10
        Account: XENAPP65\Administrator
        Change description: Published application Paint was modified.
        Type of change: Modified
        Type of item: Application
        Name of item: Paint
    

    Next up is Load Balancing Policies. This node was a challenge due to all the multiple conditions that can be set.

    #load balancing policies
    $LoadBalancingPolicies = Get-XALoadBalancingPolicy -EA 0 | sort-object PolicyName
    
    If( $? -and $LoadBalancingPolicies)
    {
    	line 0 ""
    	line 0 "Load Balancing Policies:"
    	ForEach($LoadBalancingPolicy in $LoadBalancingPolicies)
    	{
    		$LoadBalancingPolicyConfiguration = Get-XALoadBalancingPolicyConfiguration -PolicyName $LoadBalancingPolicy.PolicyName
    		$LoadBalancingPolicyFilter = Get-XALoadBalancingPolicyFilter -PolicyName $LoadBalancingPolicy.PolicyName
    
    		line 1 "Load balancing policy name: " $LoadBalancingPolicy.PolicyName
    		line 2 "Load balancing policy description: " $LoadBalancingPolicy.Description
    		line 2 "Load balancing policy enabled: " $LoadBalancingPolicy.Enabled
    		line 2 "Load balancing policy priority: " $LoadBalancingPolicy.Priority
    
    		line 2 "Filter based on Access Control: " $LoadBalancingPolicyFilter.AccessControlEnabled
    		If($LoadBalancingPolicyFilter.AccessControlEnabled)
    		{
    			line 2 "Apply to connections made through Access Gateway: " $LoadBalancingPolicyFilter.AllowConnectionsThroughAccessGateway
    			If($LoadBalancingPolicyFilter.AllowConnectionsThroughAccessGateway)
    			{
    				If($LoadBalancingPolicyFilter.AllowOtherConnections)
    				{
    					line 3 "Any connection"
    				}
    				Else
    				{
    					line 3 "Any connection that meets any of the following filters"
    					If($LoadBalancingPolicyFilter.AccessSessionConditions)
    					{
    						ForEach($AccessSessionCondition in $LoadBalancingPolicyFilter.AccessSessionConditions)
    						{
    							line 4 $AccessSessionCondition
    						}
    					}
    				}
    			}
    		}
    
    		If($LoadBalancingPolicyFilter.ClientIPAddressEnabled)
    		{
    			line 2 "Filter based on client IP address"
    			If($LoadBalancingPolicyFilter.ApplyToAllClientIPAddresses)
    			{
    				line 3 "Apply to all client IP addresses: " $LoadBalancingPolicyFilter.ApplyToAllClientIPAddresses
    			}
    			Else
    			{
    				If($LoadBalancingPolicyFilter.AllowedIPAddresses)
    				{
    					ForEach($AllowedIPAddress in $LoadBalancingPolicyFilter.AllowedIPAddresses)
    					{
    						line 3 "Client IP Address Matched: " $AllowedIPAddress
    					}
    				}
    				If($LoadBalancingPolicyFilter.DeniedIPAddresses)
    				{
    					ForEach($DeniedIPAddress in $LoadBalancingPolicyFilter.DeniedIPAddresses)
    					{
    						line 3 "Client IP Address Ignored: " $DeniedIPAddress
    					}
    				}
    			}
    		}
    		If($LoadBalancingPolicyFilter.ClientNameEnabled)
    		{
    			line 2 "Filter based on client name"
    			If($LoadBalancingPolicyFilter.ApplyToAllClientNames)
    			{
    				line 3 "Apply to all client names: " $LoadBalancingPolicyFilter.ApplyToAllClientNames
    			}
    			Else
    			{
    				If($LoadBalancingPolicyFilter.AllowedClientNames)
    				{
    					ForEach($AllowedClientName in $LoadBalancingPolicyFilter.AllowedClientNames)
    					{
    						line 3 "Client Name Matched: " $AllowedClientName
    					}
    				}
    				If($LoadBalancingPolicyFilter.DeniedClientNames)
    				{
    					ForEach($DeniedClientName in $LoadBalancingPolicyFilter.DeniedClientNames)
    					{
    						line 3 "Client Name Ignored: " $DeniedClientName
    					}
    				}
    			}
    		}
    		If($LoadBalancingPolicyFilter.AccountEnabled)
    		{
    			line 2 "Filter based on user"
    			line 3 "Apply to anonymous users: " $LoadBalancingPolicyFilter.ApplyToAnonymousAccounts
    			If($LoadBalancingPolicyFilter.ApplyToAllExplicitAccounts)
    			{
    				line 3 "Apply to all explicit (non-anonymous) users: " $LoadBalancingPolicyFilter.ApplyToAllExplicitAccounts
    			}
    			Else
    			{
    				If($LoadBalancingPolicyFilter.AllowedAccounts)
    				{
    					ForEach($AllowedAccount in $LoadBalancingPolicyFilter.AllowedAccounts)
    					{
    						line 3 "User Matched: " $AllowedAccount
    					}
    				}
    				If($LoadBalancingPolicyFilter.DeniedAccounts)
    				{
    					ForEach($DeniedAccount in $LoadBalancingPolicyFilter.DeniedAccounts)
    					{
    						line 3 "User Ignored: " $DeniedAccount
    					}
    				}
    			}
    		}
    		If($LoadBalancingPolicyConfiguration.WorkerGroupPreferenceAndFailoverState)
    		{
    			line 2 "Configure application connection preference based on worker group"
    			If($LoadBalancingPolicyConfiguration.WorkerGroupPreferences)
    			{
    				ForEach($WorkerGroupPreference in $LoadBalancingPolicyConfiguration.WorkerGroupPreferences)
    				{
    					line 3 "Worker Group: " $WorkerGroupPreference
    				}
    			}
    		}
    		If($LoadBalancingPolicyConfiguration.StreamingDeliveryProtocolState)
    		{
    			line 2 "Set the delivery protocols for applications streamed to client"
    			line 3 $LoadBalancingPolicyConfiguration.StreamingDeliveryOption
    		}
    
    		Write-Output $global:output
    		$global:output = $null
    		$LoadBalancingPolicyConfiguration = $null
    		$LoadBalancingPolicyFilter = $null
    	}
    }
    Else
    {
    	line 0 "Load balancing policy information could not be retrieved"
    }
    $LoadBalancingPolicies = $null
    $global:output = $null
    

    Script output:

    Load Balancing Policies:
    
        Load balancing policy name: Sample for Script
            Load balancing policy description:
            Load balancing policy enabled: True
            Load balancing policy priority: 1
            Filter based on Access Control: False
            Filter based on client IP address
                Client IP Address Matched: 192.168.1.2-192.168.1.2
                Client IP Address Ignored: 192.168.2.1-192.168.2.254
            Filter based on client name
                Client Name Ignored: MACBOOKPRO
            Filter based on user
                Apply to anonymous users: False
                User Matched: XENAPP65\Anon000
                User Matched: XENAPP65\Anon001
                User Matched: XENAPP65\Anon002
                User Matched: XENAPP65\Anon003
                User Matched: XENAPP65\Anon004
                User Matched: XENAPP65\Anon005
                User Matched: XENAPP65\Anon006
                User Matched: XENAPP65\Anon007
                User Matched: XENAPP65\Anon008
                User Matched: XENAPP65\Anon009
                User Matched: XENAPP65\Anon010
                User Matched: XENAPP65\Anon011
                User Matched: XENAPP65\Anon012
                User Matched: XENAPP65\Anon013
                User Matched: XENAPP65\Anon014
            Configure application connection preference based on worker group
                Worker Group: 1=XenApp 6.5 Server
            Set the delivery protocols for applications streamed to client
                ForceServerAccess
    

    Next up, Load Evaluators.

    #load evaluators
    $LoadEvaluators = Get-XALoadEvaluator -EA 0 | sort-object LoadEvaluatorName
    
    If( $? )
    {
    	line 0 ""
    	line 0 "Load Evaluators:"
    	ForEach($LoadEvaluator in $LoadEvaluators)
    	{
    		line 1 "Name: " $LoadEvaluator.LoadEvaluatorName
    		line 2 "Description: " $LoadEvaluator.Description
    
    		If($LoadEvaluator.IsBuiltIn)
    		{
    			line 2 "Built-in Load Evaluator"
    		}
    		Else
    		{
    			line 2 "User created load evaluator"
    		}
    
    		If($LoadEvaluator.ApplicationUserLoadEnabled)
    		{
    			line 2 "Application User Load Settings"
    			line 3 "Report full load when the number of users for this application equals: " $LoadEvaluator.ApplicationUserLoad
    			line 3 "Application: " $LoadEvaluator.ApplicationBrowserName
    		}
    
    		If($LoadEvaluator.ContextSwitchesEnabled)
    		{
    			line 2 "Context Switches Settings"
    			line 3 "Report full load when the number of context switches per second is greater than this value: " $LoadEvaluator.ContextSwitches[1]
    			line 3 "Report no load when the number of context switches per second is less than or equal to this value: " $LoadEvaluator.ContextSwitches[0]
    		}
    
    		If($LoadEvaluator.CpuUtilizationEnabled)
    		{
    			line 2 "CPU Utilization Settings"
    			line 3 "Report full load when the processor utilization percentage is greater than this value: " $LoadEvaluator.CpuUtilization[1]
    			line 3 "Report no load when the processor utilization percentage is less than or equal to this value: " $LoadEvaluator.CpuUtilization[0]
    		}
    
    		If($LoadEvaluator.DiskDataIOEnabled)
    		{
    			line 2 "Disk Data I/O Settings"
    			line 3 "Report full load when the total disk I/O in kilobytes per second is greater than this value: " $LoadEvaluator.DiskDataIO[1]
    			line 3 "Report no load when the total disk I/O in kilobytes per second is less than or equal to this value: " $LoadEvaluator.DiskDataIO[0]
    		}
    
    		If($LoadEvaluator.DiskOperationsEnabled)
    		{
    			line 2 "Disk Operations Settings"
    			line 3 "Report full load when the total number of read and write operations per second is greater than this value: " $LoadEvaluator.DiskOperations[1]
    			line 3 "Report no load when the total number of read and write operations per second is less than or equal to this value: " $LoadEvaluator.DiskOperations[0]
    		}
    
    		If($LoadEvaluator.IPRangesEnabled)
    		{
    			line 2 "IP Range Settings"
    			If($LoadEvaluator.IPRangesAllowed)
    			{
    				line 3 "Allow " -NoNewLine
    			}
    			Else
    			{
    				line 3 "Deny " -NoNewLine
    			}
    			line 0 "client connections from the listed IP Ranges"
    			ForEach($IPRange in $LoadEvaluator.IPRanges)
    			{
    				line 4 "IP Address Ranges: " $IPRange
    			}
    		}
    
    		If($LoadEvaluator.LoadThrottlingEnabled)
    		{
    			line 2 "Load Throttling Settings"
    			line 3 "Impact of logons on load: " $LoadEvaluator.LoadThrottling
    
    		}
    
    		If($LoadEvaluator.MemoryUsageEnabled)
    		{
    			line 2 "Memory Usage Settings"
    			line 3 "Report full load when the memory usage is greater than this value: " $LoadEvaluator.MemoryUsage[1]
    			line 3 "Report no load when the memory usage is less than or equal to this value: " $LoadEvaluator.MemoryUsage[0]
    		}
    
    		If($LoadEvaluator.PageFaultsEnabled)
    		{
    			line 2 "Page Faults Settings"
    			line 3 "Report full load when the number of page faults per second is greater than this value: " $LoadEvaluator.PageFaults[1]
    			line 3 "Report no load when the number of page faults per second is less than or equal to this value: " $LoadEvaluator.PageFaults[0]
    		}
    
    		If($LoadEvaluator.PageSwapsEnabled)
    		{
    			line 2 "Page Swaps Settings"
    			line 3 "Report full load when the number of page swaps per second is greater than this value: " $LoadEvaluator.PageSwaps[1]
    			line 3 "Report no load when the number of page swaps per second is less than or equal to this value: " $LoadEvaluator.PageSwaps[0]
    		}
    
    		If($LoadEvaluator.ScheduleEnabled)
    		{
    			line 2 "Scheduling Settings"
    			line 3 "Sunday Schedule  : " $LoadEvaluator.SundaySchedule
    			line 3 "Monday Schedule  : " $LoadEvaluator.MondaySchedule
    			line 3 "Tuesday Schedule : " $LoadEvaluator.TuesdaySchedule
    			line 3 "Wednesday Schedule: " $LoadEvaluator.WednesdaySchedule
    			line 3 "Thursday Schedule : " $LoadEvaluator.ThursdaySchedule
    			line 3 "Friday Schedule  : " $LoadEvaluator.FridaySchedule
    			line 3 "Saturday Schedule : " $LoadEvaluator.SaturdaySchedule
    		}
    
    		If($LoadEvaluator.ServerUserLoadEnabled)
    		{
    			line 2 "Server User Load Settings"
    			line 3 "Report full load when the number of server users equals: " $LoadEvaluator.ServerUserLoad
    		}
    
    		line 0 ""
    		Write-Output $global:output
    		$global:output = $null
    	}
    
    }
    Else
    {
    	line 0 "Load Evaluator information could not be retrieved"
    }
    $LoadEvaluators = $null
    $global:output = $null
    

    Script output:

    Load Evaluators:
    
        Name: Advanced
            Description: Use the Advanced Load Evaluator to limit memory usage, CPU utilization, and page swaps on a server for load management.
            Built-in Load Evaluator
            CPU Utilization Settings
                Report full load when the processor utilization percentage is greater than this value: 90
                Report no load when the processor utilization percentage is less than or equal to this value: 10
            Load Throttling Settings
                Impact of logons on load: High
            Memory Usage Settings
                Report full load when the memory usage is greater than this value: 90
                Report no load when the memory usage is less than or equal to this value: 10
            Page Swaps Settings
                Report full load when the number of page swaps per second is greater than this value: 100
                Report no load when the number of page swaps per second is less than or equal to this value: 0
    
        Name: Default
            Description: The Default Load Evaluator uses the user session count for its criteria.
            Built-in Load Evaluator
            Load Throttling Settings
                Impact of logons on load: High
            Server User Load Settings
                Report full load when the number of server users equals: 100
    

    Even though Policies is next in the AppCenter, I will save that for last because of the sheer number of policy settings. So the next node we will do is Servers.

    $servers = Get-XAServer -EA 0 | sort-object FolderPath, ServerName
    
    If( $? )
    {
    	line 0 ""
    	line 0 "Servers:"
    	ForEach($server in $servers)
    	{
    		line 1 "Name: " $server.ServerName
    		line 2 "Server FQDN: " $server.ServerFqdn
    		line 2 "Product: " $server.CitrixProductName -NoNewLine
    		line 0 ", " $server.CitrixEdition -NoNewLine
    		line 0 " Edition"
    		line 2 "Version: " $server.CitrixVersion
    		line 2 "Service Pack: " $server.CitrixServicePack
    		line 2 "Operating System Type: " -NoNewLine
    		If($server.Is64Bit)
    		{
    			line 0 "64 bit"
    		}
    		Else
    		{
    			line 0 "32 bit"
    		}
    		line 2 "IP Address: " $server.IPAddresses
    		line 2 "Logon: " -NoNewLine
    		If($server.LogOnsEnabled)
    		{
    			line 0 "Enabled"
    		}
    		Else
    		{
    			line 0 "Disabled"
    		}
    		line 2 "Logon Control Mode: " $Server.LogOnMode
    		line 2 "Product Installation Date: " $server.CitrixInstallDate
    		line 2 "Operating System Version: " $server.OSVersion -NoNewLine
    		line 0 " " $server.OSServicePack
    		line 2 "Zone: " $server.ZoneName
    		line 2 "Election Preference: " $server.ElectionPreference
    		line 2 "Folder: " $server.FolderPath
    		line 2 "Product Installation Path: " $server.CitrixInstallPath
    		If($server.LicenseServerName)
    		{
    			line 2 "License Server Name: " $server.LicenseServerName
    			line 2 "License Server Port: " $server.LicenseServerPortNumber
    		}
    		If($server.ICAPortNumber -gt 0)
    		{
    			line 2 "ICA Port Number: " $server.ICAPortNumber
    		}
    		If($server.RDPPortNumber -gt 0)
    		{
    			line 2 "RDP Port Number: " $server.RDPPortNumber
    		}
    		line 2 "Is the Print Spooler on this server healthy: " $Server.IsSpoolerHealthy
    		line 2 "Power Management Control Mode: " $server.PcmMode
    
    		#applications published to server
    		$Applications = Get-XAApplication -ServerName $server.ServerName -EA 0 | sort-object FolderPath, DisplayName
    		If( $? -and $Applications )
    		{
    			line 2 "Published applications:"
    			ForEach($app in $Applications)
    			{
    				line 0 ""
    				line 3 "Display name: " $app.DisplayName
    				line 3 "Folder path: " $app.FolderPath
    			}
    		}
    		#Citrix hotfixes installed
    		$hotfixes = Get-XAServerHotfix -ServerName $server.ServerName -EA 0 | sort-object HotfixName
    		If( $? -and $hotfixes )
    		{
    			line 0 ""
    			line 2 "Citrix Hotfixes:"
    			ForEach($hotfix in $hotfixes)
    			{
    				line 0 ""
    				line 3 "Hotfix: " $hotfix.HotfixName
    				line 3 "Installed by: " $hotfix.InstalledBy
    				line 3 "Installed date: " $hotfix.InstalledOn
    				line 3 "Hotfix type: " $hotfix.HotfixType
    				line 3 "Valid: " $hotfix.Valid
    				line 3 "Hotfixes replaced: "
    				ForEach($Replaced in $hotfix.HotfixesReplaced)
    				{
    					line 4 $Replaced
    				}
    			}
    		}
    		line 0 ""
    		Write-Output $global:output
    		$global:output = $null
    	}
    }
    Else
    {
    	line 0 "Server information could not be retrieved"
    }
    $servers = $null
    $global:output = $null
    

    Script output:

    Servers:
    
        Name: XENAPP65
            Server FQDN:
            Product: Citrix Presentation Server, Platinum Edition
            Version: 6.5.6682
            Service Pack: 0
            Operating System Type: 64 bit
            IP Address: 192.168.1.152
            Logon: Enabled
            Logon Control Mode: AllowLogOns
            Product Installation Date: 10/03/2011 18:48:07
            Operating System Version: 6.1.7601 Service Pack 1
            Zone: Default Zone
            Election Preference: MostPreferred
            Folder: Servers
            Product Installation Path: C:\Program Files (x86)\Citrix\
            License Server Name: XENAPP65
            License Server Port: 27000
            ICA Port Number: 1494
            Is the Print Spooler on this server healthy:
            Power Management Control Mode: Normal
            Published applications:
                Display name: Notepad
                Folder path: Applications
            Citrix Hotfixes:
                Hotfix: XA650W2K8R2X64001
                Installed by: XENAPP65\Administrator
                Installed date: 10/03/2011 17:52:42
                Hotfix type: Hotfix
                Valid: True
                Hotfixes replaced:
    

    Next up is Worker Groups.

    #worker groups
    $WorkerGroups = Get-XAWorkerGroup -EA 0 | sort-object WorkerGroupName
    
    If( $? -and $WorkerGroups)
    {
    	line 0 ""
    	line 0 "Worker Groups:"
    	ForEach($WorkerGroup in $WorkerGroups)
    	{
    		line 0 ""
    		line 1 "Name: " $WorkerGroup.WorkerGroupName
    		line 2 "Description: " $WorkerGroup.Description
    		line 2 "Folder Path: " $WorkerGroup.FolderPath
    		If($WorkerGroup.ServerNames)
    		{
    			line 2 "Farm Servers:"
    			$TempArray = $WorkerGroup.ServerNames | Sort-Object
    			ForEach($ServerName in $TempArray)
    			{
    				line 3 $ServerName
    			}
    			$TempArray = $null
    		}
    		If($WorkerGroup.ServerGroups)
    		{
    			line 2 "Server Group Accounts:"
    			$TempArray = $WorkerGroup.ServerGroups | Sort-Object
    			ForEach($ServerGroup in $TempArray)
    			{
    				line 3 $ServerGroup
    			}
    			$TempArray = $null
    		}
    		If($WorkerGroup.OUs)
    		{
    			line 2 "Organization Units:"
    			$TempArray = $WorkerGroup.OUs | Sort-Object
    			ForEach($OU in $TempArray)
    			{
    				line 3 $OU
    			}
    			$TempArray = $null
    		}
    		#applications published to worker group
    		$Applications = Get-XAApplication -WorkerGroup $WorkerGroup.WorkerGroupName -EA 0 | sort-object FolderPath, DisplayName
    		If( $? -and $Applications )
    		{
    			line 2 "Published applications:"
    			ForEach($app in $Applications)
    			{
    				line 0 ""
    				line 3 "Display name: " $app.DisplayName
    				line 3 "Folder path: " $app.FolderPath
    			}
    		}
    
    		Write-Output $global:output
    		$global:output = $null
    	}
    }
    Else
    {
    	line 0 "Worker Group information could not be retrieved"
    }
    $WorkerGroups = $null
    $global:output = $null
    

    Script output:

    Worker Groups:
    
        Name: XenApp 6.5 Server
            Description:
            Folder Path: WorkerGroups
            Farm Servers:
                XENAPP65
            Published applications:
                Display name: Paint
                Folder path: Applications
    

    Next up, Zones.

    #zones
    $Zones = Get-XAZone -EA 0 | sort-object ZoneName
    If( $? )
    {
    	line 0 ""
    	line 0 "Zones:"
    	ForEach($Zone in $Zones)
    	{
    		line 1 "Zone Name: " $Zone.ZoneName
    		line 2 "Current Data Collector: " $Zone.DataCollector
    		$Servers = Get-XAServer -ZoneName $Zone.ZoneName -EA 0 | sort-object ElectionPreference, ServerName
    		If( $? )
    		{
    			line 2 "Servers in Zone"
    
    			ForEach($Server in $Servers)
    			{
    				line 3 "Server Name and Preference: " $server.ServerName -NoNewLine
    				line 0 " " $server.ElectionPreference
    			}
    		}
    		Else
    		{
    			line 2 "Unable to enumerate servers in the zone"
    		}
    		Write-Output $global:output
    		$global:output = $null
    		$Servers = $Null
    	}
    }
    Else
    {
    	line 0 "Zone information could not be retrieved"
    }
    $Servers = $null
    $Zones = $null
    $global:output = $null
    

    Script output:

    Zones:
    
        Zone Name: DEFAULT ZONE
            Current Data Collector: XENAPP65
            Servers in Zone
                Server Name and Preference: XENAPP65 MostPreferred
    

    WHEW! Now for the bad boy! Policies. This was very hard to do. Not only was there an incredible amount of typing involved but not all policy settings are available and just trying to figure some of this stuff out was pretty darn hard. All I can figure out how to retrieve are the IMA based farm policies. Sorry.

    For the new Multi-Port Policy setting, I needed to create a function to help make the output readable. To test this new policy setting, I created a Multi-Port Policy as shown in Figure 30.

    Figure 30
    Figure 30

    The values retrieved for this policy are returned as:

    2599,0;2600,2;2601,3;;

    Not very readable in my opinion. The CGP default port and CGP default port priority cannot be changed. I created a Function MultiPortPolicyPriority to return the priority name instead of a number.

    Function MultiPortPolicyPriority
    {
    	Param( [int]$PriorityValue = 3 )
    
    	switch ($PriorityValue)
    	{
        0 {"Very High"}
        1 {"High"}
        2 {"Medium"}
        3 {"Low"}
        default {"Unknown Priority Value"}
      }
    	Return $PriorityValue
    }
    

    You will see in the script what I needed to do to split the string “2599,0;2600,2;2601,3;;” into the port and priority values.

    Echo "Please wait while Citrix Policies are retrieved..."
    $Policies = Get-CtxGroupPolicy -EA 0 | sort-object PolicyName
    If( $? )
    {
    	line 0 ""
    	line 0 "Policies:"
    	ForEach($Policy in $Policies)
    	{
    		line 1 "Policy Name: " $Policy.PolicyName
    		line 2 "Type: " $Policy.Type
    		line 2 "Description: " $Policy.Description
    		line 2 "Enabled: " $Policy.Enabled
    		line 2 "Priority: " $Policy.Priority
    
    		$filter = Get-CtxGroupPolicyFilter -PolicyName $Policy.PolicyName -EA 0
    
    		If( $? )
    		{
    			If($Filter -and $filter.FilterName -and ($filter.FilterName.Trim() -ne ""))
    			{
    				Line 2 "Filter name: " $filter.FilterName
    				Line 2 "Filter type: " $filter.FilterType
    				Line 2 "Filter enabled: " $filter.Enabled
    				Line 2 "Filter mode: " $filter.Mode
    				Line 2 "Filter value: " $filter.FilterValue
    
    			}
    			Else
    			{
    				line 2 "No filter information"
    			}
    		}
    		Else
    		{
    			Line 2 "Unable to retrieve Filter settings"
    		}
    
    		$Settings = Get-CtxGroupPolicyConfiguration -PolicyName $Policy.PolicyName -EA 0
    		If( $? )
    		{
    			ForEach($Setting in $Settings)
    			{
    				If($Setting.Type -eq "Computer")
    				{
    					line 2 "Computer settings:"
    					If($Setting.IcaListenerTimeout.State -ne "NotConfigured")
    					{
    						line 3 "ICA\ICA listener connection timeout - Value: " $Setting.IcaListenerTimeout.Value
    					}
    					If($Setting.IcaListenerPortNumber.State -ne "NotConfigured")
    					{
    						line 3 "ICA\ICA listener port number - Value: " $Setting.IcaListenerPortNumber.Value
    					}
    					If($Setting.AutoClientReconnect.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Auto Client Reconnect\Auto client reconnect - Value: " $Setting.AutoClientReconnect.State
    					}
    					If($Setting.AutoClientReconnectLogging.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Auto Client Reconnect\Auto client reconnect logging - Value: " $Setting.AutoClientReconnectLogging.Value
    					}
    					If($Setting.IcaRoundTripCalculation.State -ne "NotConfigured")
    					{
    						line 3 "ICA\End User Monitoring\ICA round trip calculation - Value: " $Setting.IcaRoundTripCalculation.State
    					}
    					If($Setting.IcaRoundTripCalculationInterval.State -ne "NotConfigured")
    					{
    						line 3 "ICA\End User Monitoring\ICA round trip calculation interval (Seconds) - Value: " $Setting.IcaRoundTripCalculationInterval.Value
    					}
    					If($Setting.IcaRoundTripCalculationWhenIdle.State -ne "NotConfigured")
    					{
    						line 3 "ICA\End User Monitoring\ICA round trip calculations for idle connections - Value: " $Setting.IcaRoundTripCalculationWhenIdle.State
    					}
    					If($Setting.DisplayMemoryLimit.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Graphics\Display memory limit: " $Setting.DisplayMemoryLimit.Value
    					}
    					If($Setting.DisplayDegradePreference.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Graphics\Display mode degrade preference: " $Setting.DisplayDegradePreference.Value
    					}
    					If($Setting.DynamicPreview.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Graphics\Dynamic Windows Preview: " $Setting.DynamicPreview.State
    					}
    					If($Setting.ImageCaching.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Graphics\Image caching - Value: " $Setting.ImageCaching.State
    					}
    					If($Setting.MaximumColorDepth.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Graphics\Maximum allowed color depth: " $Setting.MaximumColorDepth.Value
    					}
    					If($Setting.DisplayDegradeUserNotification.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Graphics\Notify user when display mode is degraded - Value: " $Setting.DisplayDegradeUserNotification.State
    					}
    					If($Setting.QueueingAndTossing.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Graphics\Queueing and tossing - Value: " $Setting.QueueingAndTossing.State
    					}
    					If($Setting.PersistentCache.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Graphics\Caching\Persistent Cache Threshold - Value: " $Setting.PersistentCache.Value
    					}
    					If($Setting.IcaKeepAliveTimeout.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Keep ALive\ICA keep alive timeout - Value: " $Setting.IcaKeepAliveTimeout.Value
    					}
    					If($Setting.IcaKeepAlives.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Keep ALive\ICA keep alives - Value: " $Setting.IcaKeepAlives.Value
    					}
    					If($Setting.MultimediaConferencing.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Multimedia\Multimedia conferencing - Value: " $Setting.MultimediaConferencing.State
    					}
    					If($Setting.MultimediaAcceleration.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Multimedia\Windows Media Redirection - Value: " $Setting.MultimediaAcceleration.State
    					}
    					If($Setting.MultimediaAccelerationDefaultBufferSize.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Multimedia\Windows Media Redirection Buffer Size - Value: " $Setting.MultimediaAccelerationDefaultBufferSize.Value
    					}
    					If($Setting.MultimediaAccelerationUseDefaultBufferSize.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Multimedia\Windows Media Redirection Buffer Size Use - Value: " $Setting.MultimediaAccelerationUseDefaultBufferSize.State
    					}
    					If($Setting.MultiPortPolicy.State -ne "NotConfigured")
    					{
    						line 3 "ICA\MultiStream Connections\Multi-Port Policy - Value: "
    						$Tmp = $Setting.MultiPortPolicy.Value
    						$cgpport1 = $Tmp.substring(0, $Tmp.indexof(";"))
    						$cgpport2 = $Tmp.substring($cgpport1.length + 1 , $Tmp.indexof(";"))
    						$cgpport3 = $Tmp.substring((($cgpport1.length + 1)+($cgpport2.length + 1)) , $Tmp.indexof(";"))
    						$cgpport1priority = multiportpolicypriority $cgpport1.substring($cgpport1.length -1, 1)
    						$cgpport2priority = multiportpolicypriority $cgpport2.substring($cgpport2.length -1, 1)
    						$cgpport3priority = multiportpolicypriority $cgpport3.substring($cgpport3.length -1, 1)
    						$cgpport1 = $cgpport1.substring(0, $cgpport1.indexof(","))
    						$cgpport2 = $cgpport2.substring(0, $cgpport2.indexof(","))
    						$cgpport3 = $cgpport3.substring(0, $cgpport3.indexof(","))
    						line 4 "CGP port1: " $cgpport1 -nonewline
    						line 1 "priority: " $cgpport1priority[0]
    						line 4 "CGP port2: " $cgpport2 -nonewline
    						line 1 "priority: " $cgpport2priority[0]
    						line 4 "CGP port3: " $cgpport3 -nonewline
    						line 1 "priority: " $cgpport3priority[0]
    						$Tmp = $null
    						$cgpport1 = $null
    						$cgpport2 = $null
    						$cgpport3 = $null
    						$cgpport1priority = $null
    						$cgpport2priority = $null
    						$cgpport3priority = $null
    					}
    					If($Setting.MultiStreamPolicy.State -ne "NotConfigured")
    					{
    						line 3 "ICA\MultiStream Connections\Multi-Stream - Value: " $Setting.MultiStreamPolicy.State
    					}
    					If($Setting.PromptForPassword.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Security\Prompt for password - Value: " $Setting.PromptForPassword.State
    					}
    					If($Setting.IdleTimerInterval.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Server Limits\Server idle timer interval - Value: " $Setting.IdleTimerInterval.Value
    					}
    					If($Setting.SessionReliabilityConnections.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Session Reliability\Session reliability connections - Value: " $Setting.SessionReliabilityConnections.State
    					}
    					If($Setting.SessionReliabilityPort.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Session Reliability\Session reliability port number - Value: " $Setting.SessionReliabilityPort.Value
    					}
    					If($Setting.SessionReliabilityTimeout.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Session Reliability\Session reliability timeout - Value: " $Setting.SessionReliabilityTimeout.Value
    					}
    					If($Setting.Shadowing.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Shadowing\Shadowing - Value: " $Setting.Shadowing.State
    					}
    					If($Setting.LicenseServerHostName.State -ne "NotConfigured")
    					{
    						line 3 "Licensing\License server host name: " $Setting.LicenseServerHostName.Value
    					}
    					If($Setting.LicenseServerPort.State -ne "NotConfigured")
    					{
    						line 3 "Licensing\License server port: " $Setting.LicenseServerPort.Value
    					}
    					If($Setting.FarmName.State -ne "NotConfigured")
    					{
    						line 3 "Power and Capacity Management\Farm name: " $Setting.FarmName.Value
    					}
    					If($Setting.WorkloadName.State -ne "NotConfigured")
    					{
    						line 3 "Power and Capacity Management\Workload name: " $Setting.WorkloadName.Value
    					}
    					If($Setting.ConnectionAccessControl.State -ne "NotConfigured")
    					{
    						line 3 "Server Settings\Connection access control - Value: " $Setting.ConnectionAccessControl.Value
    					}
    					If($Setting.DnsAddressResolution.State -ne "NotConfigured")
    					{
    						line 3 "Server Settings\DNS address resolution - Value: " $Setting.DnsAddressResolution.State
    					}
    					If($Setting.FullIconCaching.State -ne "NotConfigured")
    					{
    						line 3 "Server Settings\Full icon caching - Value: " $Setting.FullIconCaching.State
    					}
    					If($Setting.LoadEvaluator.State -ne "NotConfigured")
    					{
    						line 3 "Server Settings\Load Evaluator Name - Value: " $Setting.LoadEvaluator.Value
    					}
    					If($Setting.ProductEdition.State -ne "NotConfigured")
    					{
    						line 3 "Server Settings\XenApp product edition - Value: " $Setting.ProductEdition.Value
    					}
    					If($Setting.ProductModel.State -ne "NotConfigured")
    					{
    						line 3 "Server Settings\XenApp product model - Value: " $Setting.ProductModel.Value
    					}
    					If($Setting.UserSessionLimit.State -ne "NotConfigured")
    					{
    						line 3 "Server Settings\Connection Limits\Limit user sessions - Value: " $Setting.UserSessionLimit.Value
    					}
    					If($Setting.UserSessionLimitAffectsAdministrators.State -ne "NotConfigured")
    					{
    						line 3 "Server Settings\Connection Limits\Limits on administrator sessions - Value: " $Setting.UserSessionLimitAffectsAdministrators.State
    					}
    					If($Setting.UserSessionLimitLogging.State -ne "NotConfigured")
    					{
    						line 3 "Server Settings\Connection Limits\Logging of logon limit events - Value: " $Setting.UserSessionLimitLogging.State
    					}
    					If($Setting.HealthMonitoring.State -ne "NotConfigured")
    					{
    						line 3 "Server Settings\Health Monitoring and Recovery\Health monitoring - Value: " $Setting.HealthMonitoring.State
    					}
    					If($Setting.HealthMonitoringTests.State -ne "NotConfigured")
    					{
    						line 3 "Server Settings\Health Monitoring and Recovery\Health monitoring tests - Value: " $Setting.HealthMonitoringTests.Value
    					}
    					If($Setting.MaximumServersOfflinePercent.State -ne "NotConfigured")
    					{
    						line 3 "Server Settings\Health Monitoring and Recovery\Maximum percent of servers with logon control - Value: " $Setting.MaximumServersOfflinePercent.Value
    					}
    					If($Setting.CpuManagementServerLevel.State -ne "NotConfigured")
    					{
    						line 3 "Server Settings\Memory/CPU\CPU management server level - Value: " $Setting.CpuManagementServerLevel.Value
    					}
    					If($Setting.MemoryOptimization.State -ne "NotConfigured")
    					{
    						line 3 "Server Settings\Memory/CPU\Memory optimization - Value: " $Setting.MemoryOptimization.State
    					}
    					If($Setting.MemoryOptimizationExcludedPrograms.State -ne "NotConfigured")
    					{
    						line 3 "Server Settings\Memory/CPU\Memory optimization application exclusion list - Value: " $Setting.MemoryOptimizationExcludedPrograms.Value
    					}
    					If($Setting.MemoryOptimizationIntervalType.State -ne "NotConfigured")
    					{
    						line 3 "Server Settings\Memory/CPU\Memory optimization interval - Value: " $Setting.MemoryOptimizationIntervalType.Value
    					}
    					If($Setting.MemoryOptimizationDayOfMonth.State -ne "NotConfigured")
    					{
    						line 3 "Server Settings\Memory/CPU\Memory optimization schedule: day of month - Value: " $Setting.MemoryOptimizationDayOfMonth.Value
    					}
    					If($Setting.MemoryOptimizationDayOfWeek.State -ne "NotConfigured")
    					{
    						line 3 "Server Settings\Memory/CPU\Memory optimization schedule: day of week - Value: " $Setting.MemoryOptimizationDayOfWeek.Value
    					}
    					If($Setting.MemoryOptimizationTime.State -ne "NotConfigured")
    					{
    						line 3 "Server Settings\Memory/CPU\Memory optimization schedule: time - Value: " $Setting.MemoryOptimizationTime.Value
    					}
    					If($Setting.OfflineClientTrust.State -ne "NotConfigured")
    					{
    						line 3 "Server Settings\Offline Applications\Offline app client trust - Value: " $Setting.OfflineClientTrust.State
    					}
    					If($Setting.OfflineEventLogging.State -ne "NotConfigured")
    					{
    						line 3 "Server Settings\Offline Applications\Offline app event logging - Value: " $Setting.OfflineEventLogging.State
    					}
    					If($Setting.OfflineLicensePeriod.State -ne "NotConfigured")
    					{
    						line 3 "Server Settings\Offline Applications\Offline app license period - Value: " $Setting.OfflineLicensePeriod.Value
    					}
    					If($Setting.OfflineUsers.State -ne "NotConfigured")
    					{
    						line 3 "Server Settings\Offline Applications\Offline app users - Value: " $Setting.OfflineUsers.Value
    					}
    					If($Setting.RebootCustomMessage.State -ne "NotConfigured")
    					{
    						line 3 "Server Settings\Reboot Behavior\Reboot custom warning - Value: " $Setting.RebootCustomMessage.State
    					}
    					If($Setting.RebootCustomMessageText.State -ne "NotConfigured")
    					{
    						line 3 "Server Settings\Reboot Behavior\Reboot custom warning text - Value: " $Setting.RebootCustomMessageText.Value
    					}
    					If($Setting.RebootDisableLogOnTime.State -ne "NotConfigured")
    					{
    						line 3 "Server Settings\Reboot Behavior\Reboot logon disable time - Value: " $Setting.RebootDisableLogOnTime.Value
    					}
    					If($Setting.RebootScheduleFrequency.State -ne "NotConfigured")
    					{
    						line 3 "Server Settings\Reboot Behavior\Reboot schedule frequency - Value: " $Setting.RebootScheduleFrequency.Value
    					}
    					If($Setting.RebootScheduleRandomizationInterval.State -ne "NotConfigured")
    					{
    						line 3 "Server Settings\Reboot Behavior\Reboot schedule randomization interval - Value: " $Setting.RebootScheduleRandomizationInterval.Value
    					}
    					If($Setting.RebootScheduleStartDate.State -ne "NotConfigured")
    					{
    						line 3 "Server Settings\Reboot Behavior\Reboot schedule start date - Value: " $Setting.RebootScheduleStartDate.Value
    					}
    					If($Setting.RebootScheduleTime.State -ne "NotConfigured")
    					{
    						line 3 "Server Settings\Reboot Behavior\Reboot schedule time - Value: " $Setting.RebootScheduleTime.Value
    					}
    					If($Setting.RebootWarningInterval.State -ne "NotConfigured")
    					{
    						line 3 "Server Settings\Reboot Behavior\Reboot warning interval - Value: " $Setting.RebootWarningInterval.Value
    					}
    					If($Setting.RebootWarningStartTime.State -ne "NotConfigured")
    					{
    						line 3 "Server Settings\Reboot Behavior\Reboot warning start time - Value: " $Setting.RebootWarningStartTime.Value
    					}
    					If($Setting.RebootWarningMessage.State -ne "NotConfigured")
    					{
    						line 3 "Server Settings\Reboot Behavior\Reboot warning to users - Value: " $Setting.RebootWarningMessage.State
    					}
    					If($Setting.ScheduledReboots.State -ne "NotConfigured")
    					{
    						line 3 "Server Settings\Reboot Behavior\Scheduled reboots - Value: " $Setting.ScheduledReboots.State
    					}
    					If($Setting.FilterAdapterAddresses.State -ne "NotConfigured")
    					{
    						line 3 "Virtual IP\Virtual IP adapter address filtering - Value: " $Setting.FilterAdapterAddresses.State
    					}
    					If($Setting.EnhancedCompatibilityPrograms.State -ne "NotConfigured")
    					{
    						line 3 "Virtual IP\Virtual IP compatibility programs list - Value: " $Setting.EnhancedCompatibilityPrograms.Value
    					}
    					If($Setting.EnhancedCompatibility.State -ne "NotConfigured")
    					{
    						line 3 "Virtual IP\Virtual IP enhanced compatibility - Value: " $Setting.EnhancedCompatibility.State
    					}
    					If($Setting.FilterAdapterAddressesPrograms.State -ne "NotConfigured")
    					{
    						line 3 "Virtual IP\Virtual IP filter adapter addresses programs list - Value: " $Setting.FilterAdapterAddressesPrograms.Value
    					}
    					If($Setting.VirtualLoopbackSupport.State -ne "NotConfigured")
    					{
    						line 3 "Virtual IP\Virtual IP loopback support - Value: " $Setting.VirtualLoopbackSupport.State
    					}
    					If($Setting.VirtualLoopbackPrograms.State -ne "NotConfigured")
    					{
    						line 3 "Virtual IP\Virtual IP virtual loopback programs list - Value: " $Setting.VirtualLoopbackPrograms.Value
    					}
    					If($Setting.TrustXmlRequests.State -ne "NotConfigured")
    					{
    						line 3 "XML Service\Trust XML requests - Value: " $Setting.TrustXmlRequests.State
    					}
    					If($Setting.XmlServicePort.State -ne "NotConfigured")
    					{
    						line 3 "XML Service\XML service port - Value: " $Setting.XmlServicePort.Value
    					}
    				}
    				Else
    				{
    					line 2 "User settings:"
    					If($Setting.ClipboardRedirection.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Client clipboard redirection - Value: " $Setting.ClipboardRedirection.State
    					}
    					If($Setting.DesktopLaunchForNonAdmins.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Desktop launches - Value: " $Setting.DesktopLaunchForNonAdmins.State
    					}
    					If($Setting.NonPublishedProgramLaunching.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Launching of non-published programs during client connection - Value: " $Setting.NonPublishedProgramLaunching.State
    					}
    					If($Setting.FlashAcceleration.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Adobe Flash Delivery\Flash Redirection\Flash acceleration - Value: " $Setting.FlashAcceleration.State
    					}
    					If($Setting.FlashUrlColorList.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Adobe Flash Delivery\Flash Redirection\Flash background color list - Values: "
    						$Values = $Setting.FlashUrlColorList.Values
    						ForEach($Value in $Values)
    						{
    							line 4 $Value
    						}
    						$Values = $null
    					}
    					If($Setting.FlashBackwardsCompatibility.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Adobe Flash Delivery\Flash Redirection\Flash backwards compatibility - Value: " $Setting.FlashBackwardsCompatibility.State
    					}
    					If($Setting.FlashDefaultBehavior.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Adobe Flash Delivery\Flash Redirection\Flash default behavior - Value: " $Setting.FlashDefaultBehavior.Value
    					}
    					If($Setting.FlashEventLogging.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Adobe Flash Delivery\Flash Redirection\Flash event logging - Value: " $Setting.FlashEventLogging.State
    					}
    					If($Setting.FlashIntelligentFallback.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Adobe Flash Delivery\Flash Redirection\Flash intelligent fallback - Value: " $Setting.FlashIntelligentFallback.State
    					}
    					If($Setting.FlashLatencyThreshold.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Adobe Flash Delivery\Flash Redirection\Flash latency threshold - Value: " $Setting.FlashLatencyThreshold.Value
    					}
    					If($Setting.FlashServerSideContentFetchingWhitelist.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Adobe Flash Delivery\Flash Redirection\Flash server-side content fetching URL list - Values: "
    						$Values = $Setting.FlashServerSideContentFetchingWhitelist.Values
    						ForEach($Value in $Values)
    						{
    							line 4 $Value
    						}
    						$Values = $null
    					}
    					If($Setting.FlashUrlCompatibilityList.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Adobe Flash Delivery\Flash Redirection\Flash URL compatibility list - Values: "
    						$Values = $Setting.FlashUrlCompatibilityList.Values
    						ForEach($Value in $Values)
    						{
    							$Spc = $Value.indexof(" ")
    							$Action = $Value.substring(0, $Spc)
    							If($Action -eq "CLIENT")
    							{
    								$Action = "Render On Client"
    							}
    							elseif ($Action -eq "SERVER")
    							{
    								$Action = "Render On Server"
    							}
    							elseif ($Action -eq "BLOCK")
    							{
    								$Action = "BLOCK      "
    							}
    							$Url = $Value.substring($Spc +1)
    							line 4 "Action: " $Action -NoNewLine
    							line 1 "URL: "$Url
    						}
    						$Values = $null
    						$Action = $null
    						$Url = $null
    					}
    					If($Setting.AllowSpeedFlash.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Adobe Flash Delivery\Legacy Server Side Optimizations\Flash quality adjustment - Value: " $Setting.AllowSpeedFlash.Value
    					}
    					If($Setting.AudioPlugNPlay.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Audio\Audio Plug N Play " $Setting.AudioPlugNPlay.State
    					}
    					If($Setting.AudioQuality.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Audio\Audio quality - Value: " $Setting.AudioQuality.Value
    					}
    					If($Setting.ClientAudioRedirection.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Audio\Client audio redirection - Value: " $Setting.ClientAudioRedirection.State
    					}
    					If($Setting.MicrophoneRedirection.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Audio\Client microphone redirection - Value: " $Setting.MicrophoneRedirection.State
    					}
    					If($Setting.AudioBandwidthLimit.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Bandwidth\Audio redirection bandwidth limit - Value: " $Setting.AudioBandwidthLimit.Value
    					}
    					If($Setting.AudioBandwidthPercent.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Bandwidth\Audio redirection bandwidth limit percent - Value: " $Setting.AudioBandwidthPercent.Value
    					}
    					If($Setting.USBBandwidthLimit.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Bandwidth\Client USB device redirection bandwidth limit - Value: " $Setting.USBBandwidthLimit.Value
    					}
    					If($Setting.USBBandwidthPercent.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Bandwidth\Client USB device redirection bandwidth limit percent - Value: " $Setting.USBBandwidthPercent.Value
    					}
    					If($Setting.ClipboardBandwidthLimit.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Bandwidth\Clipboard redirection bandwidth limit - Value: " $Setting.ClipboardBandwidthLimit.Value
    					}
    					If($Setting.ClipboardBandwidthPercent.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Bandwidth\Clipboard redirection bandwidth limit percent - Value: " $Setting.ClipboardBandwidthPercent.Value
    					}
    					If($Setting.ComPortBandwidthLimit.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Bandwidth\COM port redirection bandwidth limit - Value: " $Setting.ComPortBandwidthLimit.Value
    					}
    					If($Setting.ComPortBandwidthPercent.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Bandwidth\COM port redirection bandwidth limit percent - Value: " $Setting.ComPortBandwidthPercent.Value
    					}
    					If($Setting.FileRedirectionBandwidthLimit.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Bandwidth\File redirection bandwidth limit - Value: " $Setting.FileRedirectionBandwidthLimit.Value
    					}
    					If($Setting.FileRedirectionBandwidthPercent.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Bandwidth\File redirection bandwidth limit percent - Value: " $Setting.FileRedirectionBandwidthPercent.Value
    					}
    					If($Setting.HDXMultimediaBandwidthLimit.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Bandwidth\HDX MediaStream Multimedia Acceleration bandwidth limit - Value: " $Setting.HDXMultimediaBandwidthLimit.Value
    					}
    					If($Setting.HDXMultimediaBandwidthPercent.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Bandwidth\HDX MediaStream Multimedia Acceleration bandwidth limit percent - Value: " $Setting.HDXMultimediaBandwidthPercent.Value
    					}
    					If($Setting.LptBandwidthLimit.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Bandwidth\LPT port redirection bandwidth limit - Value: " $Setting.LptBandwidthLimit.Value
    					}
    					If($Setting.LptBandwidthLimitPercent.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Bandwidth\LPT port redirection bandwidth limit percent - Value: " $Setting.LptBandwidthLimitPercent.Value
    					}
    					If($Setting.OverallBandwidthLimit.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Bandwidth\Overall session bandwidth limit - Value: " $Setting.OverallBandwidthLimit.Value
    					}
    					If($Setting.PrinterBandwidthLimit.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Bandwidth\Printer redirection bandwidth limit - Value: " $Setting.PrinterBandwidthLimit.Value
    					}
    					If($Setting.PrinterBandwidthPercent.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Bandwidth\Printer redirection bandwidth limit percent - Value: " $Setting.PrinterBandwidthPercent.Value
    					}
    					If($Setting.TwainBandwidthLimit.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Bandwidth\TWAIN device redirection bandwidth limit - Value: " $Setting.TwainBandwidthLimit.Value
    					}
    					If($Setting.TwainBandwidthPercent.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Bandwidth\TWAIN device redirection bandwidth limit percent - Value: " $Setting.TwainBandwidthPercent.Value
    					}
    					If($Setting.DesktopWallpaper.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Desktop UI\Desktop wallpaper - Value: " $Setting.DesktopWallpaper.State
    					}
    					If($Setting.MenuAnimation.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Desktop UI\Menu animation - Value: " $Setting.MenuAnimation.State
    					}
    					If($Setting.WindowContentsVisibleWhileDragging.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Desktop UI\View window contents while dragging - Value: " $Setting.WindowContentsVisibleWhileDragging.State
    					}
    					If($Setting.AutoConnectDrives.State -ne "NotConfigured")
    					{
    						line 3 "ICA\File Redirection\Auto connect client drives - Value: " $Setting.AutoConnectDrives.State
    					}
    					If($Setting.ClientDriveRedirection.State -ne "NotConfigured")
    					{
    						line 3 "ICA\File Redirection\Client drive redirection - Value: " $Setting.ClientDriveRedirection.State
    					}
    					If($Setting.ClientFixedDrives.State -ne "NotConfigured")
    					{
    						line 3 "ICA\File Redirection\Client fixed drives - Value: " $Setting.ClientFixedDrives.State
    					}
    					If($Setting.ClientFloppyDrives.State -ne "NotConfigured")
    					{
    						line 3 "ICA\File Redirection\Client floppy drives - Value: " $Setting.ClientFloppyDrives.State
    					}
    					If($Setting.ClientNetworkDrives.State -ne "NotConfigured")
    					{
    						line 3 "ICA\File Redirection\Client network drives - Value: " $Setting.ClientNetworkDrives.State
    					}
    					If($Setting.ClientOpticalDrives.State -ne "NotConfigured")
    					{
    						line 3 "ICA\File Redirection\Client optical drives - Value: " $Setting.ClientOpticalDrives.State
    					}
    					If($Setting.ClientRemoveableDrives.State -ne "NotConfigured")
    					{
    						line 3 "ICA\File Redirection\Client removable drives - Value: " $Setting.ClientRemoveableDrives.State
    					}
    					If($Setting.HostToClientRedirection.State -ne "NotConfigured")
    					{
    						line 3 "ICA\File Redirection\Host to client redirection - Value: " $Setting.HostToClientRedirection.State
    					}
    					If($Setting.ReadOnlyMappedDrive.State -ne "NotConfigured")
    					{
    						line 3 "ICA\File Redirection\Read-only client drive access - Value: " $Setting.ReadOnlyMappedDrive.State
    					}
    					If($Setting.SpecialFolderRedirection.State -ne "NotConfigured")
    					{
    						line 3 "ICA\File Redirection\Special folder redirection - Value: " $Setting.SpecialFolderRedirection.State
    					}
    					If($Setting.AsynchronousWrites.State -ne "NotConfigured")
    					{
    						line 3 "ICA\File Redirection\Use asynchronous writes - Value: " $Setting.AsynchronousWrites.State
    					}
    					If($Setting.MultiStream.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Multi-Stream Connections\Multi-Stream - Value: " $Setting.MultiStream.State
    					}
    					If($Setting.ClientComPortsAutoConnection.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Port Redirection\Auto connect client COM ports - Value: " $Setting.ClientComPortsAutoConnection.State
    					}
    					If($Setting.ClientLptPortsAutoConnection.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Port Redirection\Auto connect client LPT ports - Value: " $Setting.ClientLptPortsAutoConnection.State
    					}
    					If($Setting.ClientComPortRedirection.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Port Redirection\Client COM port redirection - Value: " $Setting.ClientComPortRedirection.State
    					}
    					If($Setting.ClientLptPortRedirection.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Port Redirection\Client LPT port redirection - Value: " $Setting.ClientLptPortRedirection.State
    					}
    					If($Setting.ClientPrinterRedirection.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Printing\Client printer redirection - Value: " $Setting.ClientPrinterRedirection.State
    					}
    					If($Setting.DefaultClientPrinter.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Printing\Default printer - Value: " $Setting.DefaultClientPrinter.Value
    					}
    					If($Setting.AutoCreationEventLogPreference.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Printing\Printer auto-creation event log preference - Value: " $Setting.AutoCreationEventLogPreference.Value
    					}
    					If($Setting.SessionPrinters.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Printing\Session printers - Value: " $Setting.SessionPrinters.State
    					}
    					If($Setting.WaitForPrintersToBeCreated.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Printing\Wait for printers to be created (desktop) - Value: " $Setting.WaitForPrintersToBeCreated.State
    					}
    					If($Setting.ClientPrinterAutoCreation.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Printing\Client Printers\Auto-create client printers - Value: " $Setting.ClientPrinterAutoCreation.Value
    					}
    					If($Setting.GenericUniversalPrinterAutoCreation.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Printing\Client Printers\Auto-create generic universal printer - Value: " $Setting.GenericUniversalPrinterAutoCreation.Value
    					}
    					If($Setting.ClientPrinterNames.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Printing\Client Printers\Client printer names - Value: " $Setting.ClientPrinterNames.Value
    					}
    					If($Setting.DirectConnectionsToPrintServers.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Printing\Client Printers\Direct connections to print servers - Value: " $Setting.DirectConnectionsToPrintServers.State
    					}
    					If($Setting.PrinterDriverMappings.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Printing\Client Printers\Printer driver mapping and compatibility - Value: " $Setting.PrinterDriverMappings.State
    					}
    					If($Setting.PrinterPropertiesRetention.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Printing\Client Printers\Printer properties retention - Value: " $Setting.PrinterPropertiesRetention.Value
    					}
    					If($Setting.RetainedAndRestoredClientPrinters.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Printing\Client Printers\Retained and restored client printers - Value: " $Setting.RetainedAndRestoredClientPrinters.State
    					}
    					If($Setting.InboxDriverAutoInstallation.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Printing\Drivers\Automatic installation of in-box printer drivers - Value: " $Setting.InboxDriverAutoInstallation.State
    					}
    					If($Setting.UniversalDriverPriority.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Printing\Drivers\Universal driver preference - Value: " $Setting.UniversalDriverPriority.Value
    					}
    					If($Setting.UniversalPrintDriverUsage.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Printing\Drivers\Universal print driver usage - Value: " $Setting.UniversalPrintDriverUsage.Value
    					}
    					If($Setting.EMFProcessingMode.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Printing\Universal Printing\Universal printing EMF processing mode - Value: " $Setting.EMFProcessingMode.Value
    					}
    					If($Setting.ImageCompressionLimit.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Printing\Universal Printing\Universal printing image compression limit - Value: " $Setting.ImageCompressionLimit.Value
    					}
    					If($Setting.UPDCompressionDefaults.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Printing\Universal Printing\Universal printing optimization default - Value: " -NoNewLine
    						$Tmp = "`t`t" + $Setting.UPDCompressionDefaults.Value.replace(";","`n`t`t`t`t")
    						line 4 $Tmp
    						$Tmp = $null
    					}
    					If($Setting.UniversalPrintingPreviewPreference.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Printing\Universal Printing\Universal printing preview preference - Value: " $Setting.UniversalPrintingPreviewPreference.Value
    					}
    					If($Setting.DPILimit.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Printing\Universal Printing\Universal printing print quality limit - Value: " $Setting.DPILimit.Value
    					}
    					If($Setting.MinimumEncryptionLevel.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Security\SecureICA minimum encryption level - Value: " $Setting.MinimumEncryptionLevel.Value
    					}
    					If($Setting.ConcurrentLogOnLimit.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Session limits\Concurrent logon limit - Value: " $Setting.ConcurrentLogOnLimit.Value
    					}
    					If($Setting.SessionDisconnectTimer.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Session Limits\Disconnected session timer - Value: " $Setting.SessionDisconnectTimer.State
    					}
    					If($Setting.SessionDisconnectTimerInterval.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Session Limits\Disconnected session timer interval - Value: " $Setting.SessionDisconnectTimerInterval.Value
    					}
    					If($Setting.LingerDisconnectTimerInterval.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Session Limits\Linger Disconnect Timer Interval - Value: " $Setting.LingerDisconnectTimerInterval.Value
    					}
    					If($Setting.LingerTerminateTimerInterval.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Session Limits\Linger Terminate Timer Interval - Value: " $Setting.LingerTerminateTimerInterval.Value
    					}
    					If($Setting.PrelaunchDisconnectTimerInterval.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Session Limits\Pre-launch Disconnect Timer Interval - Value: " $Setting.PrelaunchDisconnectTimerInterval.Value
    					}
    					If($Setting.PrelaunchTerminateTimerInterval.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Session Limits\Pre-launch Terminate Timer Interval - Value: " $Setting.PrelaunchTerminateTimerInterval.Value
    					}
    					If($Setting.SessionConnectionTimer.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Session Limits\Session connection timer - Value: " $Setting.SessionConnectionTimer.State
    					}
    					If($Setting.SessionConnectionTimerInterval.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Session Limits\Session connection timer interval - Value: " $Setting.SessionConnectionTimerInterval.Value
    					}
    					If($Setting.SessionIdleTimer.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Session Limits\Session idle timer - Value: " $Setting.SessionIdleTimer.State
    					}
    					If($Setting.SessionIdleTimerInterval.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Session Limits\Session idle timer interval - Value: " $Setting.SessionIdleTimerInterval.Value
    					}
    					If($Setting.ShadowInput.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Shadowing\Input from shadow connections - Value: " $Setting.ShadowInput.State
    					}
    					If($Setting.ShadowLogging.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Shadowing\Log shadow attempts - Value: " $Setting.ShadowLogging.State
    					}
    					If($Setting.ShadowUserNotification.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Shadowing\Notify user of pending shadow connections - Value: " $Setting.ShadowUserNotification.State
    					}
    					If($Setting.ShadowAllowList.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Shadowing\Users who can shadow other users - Value: " $Setting.ShadowAllowList.Value
    					}
    					If($Setting.ShadowDenyList.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Shadowing\Users who cannot shadow other users - Value: " $Setting.ShadowDenyList.Value
    					}
    					If($Setting.LocalTimeEstimation.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Time Zone Control\Estimate local time for legacy clients - Value: " $Setting.LocalTimeEstimation.State
    					}
    					If($Setting.SessionTimeZone.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Time Zone Control\Use local time of client - Value: " $Setting.SessionTimeZone.Value
    					}
    					If($Setting.TwainRedirection.State -ne "NotConfigured")
    					{
    						line 3 "ICA\TWAIN devices\Client TWAIN device redirection - Value: " $Setting.TwainRedirection.State
    					}
    					If($Setting.TwainCompressionLevel.State -ne "NotConfigured")
    					{
    						line 3 "ICA\TWAIN devices\TWAIN compression level - Value: " $Setting.TwainCompressionLevel.Value
    					}
    					If($Setting.UsbDeviceRedirection.State -ne "NotConfigured")
    					{
    						line 3 "ICA\USB devices\Client USB device redirection - Value: " $Setting.UsbDeviceRedirection.State
    					}
    					If($Setting.UsbDeviceRedirectionRules.State -ne "NotConfigured")
    					{
    						line 3 "ICA\USB devices\Client USB device redirection rules - Value: " $Setting.UsbDeviceRedirectionRules.Value
    					}
    					If($Setting.UsbPlugAndPlayRedirection.State -ne "NotConfigured")
    					{
    						line 3 "ICA\USB devices\Client USB Plug and Play device redirection - Value: " $Setting.UsbPlugAndPlayRedirection.State
    					}
    					If($Setting.FramesPerSecond.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Visual Display\Max Frames Per Second - Value: " $Setting.FramesPerSecond.Value
    					}
    					If($Setting.ProgressiveCompressionLevel.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Visual Display\Moving Images\Progressive compression level - Value: " $Setting.ProgressiveCompressionLevel.Value
    					}
    					If($Setting.ProgressiveCompressionThreshold.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Visual Display\Moving Images\Progressive compression threshold value - Value: " $Setting.ProgressiveCompressionThreshold.Value
    					}
    					If($Setting.ExtraColorCompression.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Visual Display\Still Images\Extra Color Compression - Value: " $Setting.ExtraColorCompression.State
    					}
    					If($Setting.ExtraColorCompressionThreshold.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Visual Display\Still Images\Extra Color Compression Threshold - Value: " $Setting.ExtraColorCompressionThreshold.Value
    					}
    					If($Setting.ProgressiveHeavyweightCompression.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Visual Display\Still Images\Heavyweight compression - Value: " $Setting.ProgressiveHeavyweightCompression.State
    					}
    					If($Setting.LossyCompressionLevel.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Visual Display\Still Images\Lossy compression level - Value: " $Setting.LossyCompressionLevel.Value
    					}
    					If($Setting.LossyCompressionThreshold.State -ne "NotConfigured")
    					{
    						line 3 "ICA\Visual Display\Still Images\Lossy compression threshold value - Value: " $Setting.LossyCompressionThreshold.Value
    					}
    					If($Setting.SessionImportance.State -ne "NotConfigured")
    					{
    						line 3 "Server Session Settings\Session importance - Value: " $Setting.SessionImportance.Value
    					}
    					If($Setting.SingleSignOn.State -ne "NotConfigured")
    					{
    						line 3 "Server Session Settings\Single Sign-On - Value: " $Setting.SingleSignOn.State
    					}
    					If($Setting.SingleSignOnCentralStore.State -ne "NotConfigured")
    					{
    						line 3 "Server Session Settings\Single Sign-On central store - Value: " $Setting.SingleSignOnCentralStore.Value
    					}
    				}
    			}
    		}
    		Else
    		{
    			line 2 "Unable to retrieve settings"
    		}
    
    		Write-Output $global:output
    		$global:output = $null
    		$Filter = $null
    		$Settings = $null
    	}
    }
    Else
    {
    	line 0 "Citrix Policy information could not be retrieved. Was the Citrix.GroupPolicy.Command module imported?"
    }
    $Policies = $null
    $global:output = $null
    

    Script output:

    Policies:
    
      Policy Name: Unfiltered
    			Type: User
    			Description:
    			Enabled: True
    			Priority: 1
    			No filter information
    			Computer settings:
    					ICA\Graphics\Dynamic Windows Preview: Enabled
    					ICA\Graphics\Caching\Persistent Cache Threshold - Value: 3000000
    					ICA\Multimedia\Multimedia conferencing - Value: Allowed
    					ICA\Multimedia\Windows Media Redirection - Value: Allowed
    					ICA\Multimedia\Windows Media Redirection Buffer Size - Value: 10
    					ICA\Multimedia\Windows Media Redirection Buffer Size Use - Value: Enabled
    					ICA\MultiStream Connections\Multi-Port Policy - Value:
    							CGP port1: 2599  priority: Very High
    							CGP port2: 2600  priority: Medium
    							CGP port3: 2601  priority: Low
    					ICA\MultiStream Connections\Multi-Stream - Value: Enabled
    					Licensing\License server host name: XENAPP65
    					Power and Capacity Management\Farm name: PCMFarm
    					Power and Capacity Management\Workload name: PCMFarmWorkload
    					Server Settings\Load Evaluator Name - Value: LoadEvaluatorName
    					Server Settings\XenApp product edition - Value: Platinum
    					Server Settings\XenApp product model - Value: XenAppCCU
    					Server Settings\Health Monitoring and Recovery\Maximum percent of servers with logon control - Value: 17
    					Server Settings\Reboot Behavior\Reboot schedule randomization interval - Value: 13
    			User settings:
    					ICA\Adobe Flash Delivery\Flash Redirection\Flash acceleration - Value: Enabled
    					ICA\Adobe Flash Delivery\Flash Redirection\Flash background color list - Values:
    							http://www.sitetomatch.com FF0000
    							http://www.sitetomatch1.com FF0001
    							http://www.sitetomatch2.com FF0002
    					ICA\Adobe Flash Delivery\Flash Redirection\Flash backwards compatibility - Value: Enabled
    					ICA\Adobe Flash Delivery\Flash Redirection\Flash default behavior - Value: Enable
    					ICA\Adobe Flash Delivery\Flash Redirection\Flash event logging - Value: Enabled
    					ICA\Adobe Flash Delivery\Flash Redirection\Flash intelligent fallback - Value: Enabled
    					ICA\Adobe Flash Delivery\Flash Redirection\Flash latency threshold - Value: 75
    					ICA\Adobe Flash Delivery\Flash Redirection\Flash server-side content fetching URL list - Values:
    							 http://www.sitetoallow.com/*
    							 http://www.sitetoallow1.com/*
    							 http://www.sitetoallow2.com/*
    							 http://www.site with spaces.com/*
    					ICA\Adobe Flash Delivery\Flash Redirection\Flash URL compatibility list - Values:
    							Action: BLOCK        URL: http://www.sitetoblock.com/*
    							Action: Render On Client   URL: http://www.sitetoRenderOnClient.com/*
    							Action: Render On Server   URL: http://www.sitetoRenderOnServer.com/*
    					ICA\Adobe Flash Delivery\Legacy Server Side Optimizations\Flash quality adjustment - Value: RestrictedBandwidth
    					ICA\Audio\Audio Plug N Play Allowed
    					ICA\Bandwidth\Client USB device redirection bandwidth limit - Value: 11
    					ICA\Bandwidth\Client USB device redirection bandwidth limit percent - Value: 22
    					ICA\Bandwidth\HDX MediaStream Multimedia Acceleration bandwidth limit - Value: 12
    					ICA\Bandwidth\HDX MediaStream Multimedia Acceleration bandwidth limit percent - Value: 24
    					ICA\Multi-Stream Connections\Multi-Stream - Value: Enabled
    					ICA\Port Redirection\Auto connect client COM ports - Value: Enabled
    					ICA\Port Redirection\Auto connect client LPT ports - Value: Enabled
    					ICA\Port Redirection\Client COM port redirection - Value: Allowed
    					ICA\Port Redirection\Client LPT port redirection - Value: Allowed
    					ICA\Printing\Default printer - Value: ClientDefault
    					ICA\Printing\Client Printers\Auto-create client printers - Value: DoNotAutoCreate
    					ICA\Printing\Client Printers\Auto-create generic universal printer - Value:
    					ICA\Printing\Client Printers\Printer driver mapping and compatibility - Value: Enabled
    					ICA\Printing\Drivers\Automatic installation of in-box printer drivers - Value: Disabled
    					ICA\Printing\Drivers\Universal driver preference - Value: EMF;XPS;PCL5c;PCL4;PS
    					ICA\Printing\Drivers\Universal print driver usage - Value: UpdOnly
    					ICA\Printing\Universal Printing\Universal printing EMF processing mode - Value: SpoolDirectlyToPrinter
    					ICA\Printing\Universal Printing\Universal printing image compression limit - Value: LosslessCompression
    					ICA\Printing\Universal Printing\Universal printing optimization default - Value:
    							ImageCompression=BestQuality
    							HeavyweightCompression=False
    							ImageCaching=True
    							FontCaching=True
    							AllowNonAdminsToModify=False
    					ICA\Printing\Universal Printing\Universal printing preview preference - Value: AutoCreatedAndGeneric
    					ICA\Printing\Universal Printing\Universal printing print quality limit - Value: HighResolution
    					ICA\Session limits\Concurrent logon limit - Value: 1
    					ICA\Session Limits\Disconnected session timer - Value: Enabled
    					ICA\Session Limits\Disconnected session timer interval - Value: 90
    					ICA\Session Limits\Linger Disconnect Timer Interval - Value: 5
    					ICA\Session Limits\Linger Terminate Timer Interval - Value: 6
    					ICA\Session Limits\Pre-launch Disconnect Timer Interval - Value: 60
    					ICA\Session Limits\Pre-launch Terminate Timer Interval - Value: 60
    					ICA\Session Limits\Session connection timer - Value: Enabled
    					ICA\Session Limits\Session connection timer interval - Value: 1440
    					ICA\Session Limits\Session idle timer - Value: Enabled
    					ICA\Session Limits\Session idle timer interval - Value: 1440
    					ICA\Visual Display\Max Frames Per Second - Value: 30
    
    	Policy Name: Unfiltered
    			Type: Computer
    			Description:
    			Enabled: True
    			Priority: 1
    			No filter information
    			Computer settings:
    					ICA\Graphics\Dynamic Windows Preview: Enabled
    					ICA\Graphics\Caching\Persistent Cache Threshold - Value: 3000000
    					ICA\Multimedia\Multimedia conferencing - Value: Allowed
    					ICA\Multimedia\Windows Media Redirection - Value: Allowed
    					ICA\Multimedia\Windows Media Redirection Buffer Size - Value: 10
    					ICA\Multimedia\Windows Media Redirection Buffer Size Use - Value: Enabled
    					ICA\MultiStream Connections\Multi-Port Policy - Value:
    							CGP port1: 2599  priority: Very High
    							CGP port2: 2600  priority: Medium
    							CGP port3: 2601  priority: Low
    					ICA\MultiStream Connections\Multi-Stream - Value: Enabled
    					Licensing\License server host name: XENAPP65
    					Power and Capacity Management\Farm name: PCMFarm
    					Power and Capacity Management\Workload name: PCMFarmWorkload
    					Server Settings\Load Evaluator Name - Value: LoadEvaluatorName
    					Server Settings\XenApp product edition - Value: Platinum
    					Server Settings\XenApp product model - Value: XenAppCCU
    					Server Settings\Health Monitoring and Recovery\Maximum percent of servers with logon control - Value: 17
    					Server Settings\Reboot Behavior\Reboot schedule randomization interval - Value: 13
    			User settings:
    					ICA\Adobe Flash Delivery\Flash Redirection\Flash acceleration - Value: Enabled
    					ICA\Adobe Flash Delivery\Flash Redirection\Flash background color list - Values:
    							http://www.sitetomatch.com FF0000
    							http://www.sitetomatch1.com FF0001
    							http://www.sitetomatch2.com FF0002
    					ICA\Adobe Flash Delivery\Flash Redirection\Flash backwards compatibility - Value: Enabled
    					ICA\Adobe Flash Delivery\Flash Redirection\Flash default behavior - Value: Enable
    					ICA\Adobe Flash Delivery\Flash Redirection\Flash event logging - Value: Enabled
    					ICA\Adobe Flash Delivery\Flash Redirection\Flash intelligent fallback - Value: Enabled
    					ICA\Adobe Flash Delivery\Flash Redirection\Flash latency threshold - Value: 75
    					ICA\Adobe Flash Delivery\Flash Redirection\Flash server-side content fetching URL list - Values:
    							 http://www.sitetoallow.com/*
    							 http://www.sitetoallow1.com/*
    							 http://www.sitetoallow2.com/*
    							 http://www.site with spaces.com/*
    					ICA\Adobe Flash Delivery\Flash Redirection\Flash URL compatibility list - Values:
    							Action: BLOCK        URL: http://www.sitetoblock.com/*
    							Action: Render On Client   URL: http://www.sitetoRenderOnClient.com/*
    							Action: Render On Server   URL: http://www.sitetoRenderOnServer.com/*
    					ICA\Adobe Flash Delivery\Legacy Server Side Optimizations\Flash quality adjustment - Value: RestrictedBandwidth
    					ICA\Audio\Audio Plug N Play Allowed
    					ICA\Bandwidth\Client USB device redirection bandwidth limit - Value: 11
    					ICA\Bandwidth\Client USB device redirection bandwidth limit percent - Value: 22
    					ICA\Bandwidth\HDX MediaStream Multimedia Acceleration bandwidth limit - Value: 12
    					ICA\Bandwidth\HDX MediaStream Multimedia Acceleration bandwidth limit percent - Value: 24
    					ICA\Multi-Stream Connections\Multi-Stream - Value: Enabled
    					ICA\Port Redirection\Auto connect client COM ports - Value: Enabled
    					ICA\Port Redirection\Auto connect client LPT ports - Value: Enabled
    					ICA\Port Redirection\Client COM port redirection - Value: Allowed
    					ICA\Port Redirection\Client LPT port redirection - Value: Allowed
    					ICA\Printing\Default printer - Value: ClientDefault
    					ICA\Printing\Client Printers\Auto-create client printers - Value: DoNotAutoCreate
    					ICA\Printing\Client Printers\Auto-create generic universal printer - Value:
    					ICA\Printing\Client Printers\Printer driver mapping and compatibility - Value: Enabled
    					ICA\Printing\Drivers\Automatic installation of in-box printer drivers - Value: Disabled
    					ICA\Printing\Drivers\Universal driver preference - Value: EMF;XPS;PCL5c;PCL4;PS
    					ICA\Printing\Drivers\Universal print driver usage - Value: UpdOnly
    					ICA\Printing\Universal Printing\Universal printing EMF processing mode - Value: SpoolDirectlyToPrinter
    					ICA\Printing\Universal Printing\Universal printing image compression limit - Value: LosslessCompression
    					ICA\Printing\Universal Printing\Universal printing optimization default - Value:
    							ImageCompression=BestQuality
    							HeavyweightCompression=False
    							ImageCaching=True
    							FontCaching=True
    							AllowNonAdminsToModify=False
    					ICA\Printing\Universal Printing\Universal printing preview preference - Value: AutoCreatedAndGeneric
    					ICA\Printing\Universal Printing\Universal printing print quality limit - Value: HighResolution
    					ICA\Session limits\Concurrent logon limit - Value: 1
    					ICA\Session Limits\Disconnected session timer - Value: Enabled
    					ICA\Session Limits\Disconnected session timer interval - Value: 90
    					ICA\Session Limits\Linger Disconnect Timer Interval - Value: 5
    					ICA\Session Limits\Linger Terminate Timer Interval - Value: 6
    					ICA\Session Limits\Pre-launch Disconnect Timer Interval - Value: 60
    					ICA\Session Limits\Pre-launch Terminate Timer Interval - Value: 60
    					ICA\Session Limits\Session connection timer - Value: Enabled
    					ICA\Session Limits\Session connection timer interval - Value: 1440
    					ICA\Session Limits\Session idle timer - Value: Enabled
    					ICA\Session Limits\Session idle timer interval - Value: 1440
    					ICA\Visual Display\Max Frames Per Second - Value: 30
    

    How to use this script?

    I saved the script as XA65_Inventory.ps1 in the C:\PSScripts folder. From the PowerShell prompt, change to the C:\PSScripts folder, or the folder where you saved the script. From the PowerShell prompt, type in:

    .\XA65_Inventory.ps1 |out-file .\XA65Farm.txt and press Enter.

    Open XA65Farm.txt in either WordPad or Microsoft Word (Figure 31).

    Figure 31
    Figure 31

    The first update I have planned for this script is to implement generating the output in Word format. This will allow for using Word Headings and formatting. If you have any suggestions for the script, please let me know. Send an e-mail to webster@carlwebster.com.

    NOTE: This script is continually updated.  You can always find the most current version by going to https://carlwebster.com/where-to-get-copies-of-the-documentation-scripts/

     

    ,





    About Carl Webster

    Webster is a Sr. Solutions Architect for Choice Solutions, LLC and specializes in Citrix, Active Directory and Technical Documentation. Webster has been working with Citrix products for many years starting with Multi-User OS/2 in 1990.

    View all posts by Carl Webster

    50 Responses to “Documenting a Citrix XenApp 6.5 Farm with Microsoft PowerShell”

    1. Balaji S Says:

      Hi Everyone,

      Please help me on make a documenting the “Loadevaluators” from XenApp6.5 used Application and Used by Server with script or whatever. It’s very urgent please help me on this..

      Thanks in advance.

      Reply

    2. Rajib Chanda Says:

      getting this error

      PS C:\Users\TEMP> .\XA65_Inventory_V43.ps1
      VERBOSE: 08/13/2017 13:09:44: Testing output parameters
      VERBOSE: 08/13/2017 13:09:44: MSWord is set
      VERBOSE: 08/13/2017 13:09:44: CoName is
      Loading Windows PowerShell snap-in: Citrix.XenApp.Commands
      VERBOSE: 08/13/2017 13:09:44: Remoting is not being used
      VERBOSE: 08/13/2017 13:09:44: Getting initial Farm data
      WARNING: Farm information could not be retrieved
      C:\Users\TEMP\XA65_Inventory_V43.ps1 : Farm information could not be retrieved. Script cannot continue.
      At line:1 char:1
      + .\XA65_Inventory_V43.ps1
      + ~~~~~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
      + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,XA65_Inventory_V43.ps1

      Reply

      • Carl Webster Says:

        Are you running the script on a Data Collector?

        Webster

        Reply

        • Rajib Chanda Says:

          on a citrix test server

          Reply

        • Rajib Chanda Says:

          Yes sir, I followed the same…help to run that script

          Reply

          • Carl Webster Says:

            On your test server, run a simple test. Start a PowerShell prompt and run the following commands:

            add-pssnapin *citrix*
            get-XAFarm

            What happens?

            Webster

            Reply

        • Rajib Chanda Says:

          FarmName : OUP
          ServerVersion : 6.5.0
          AdministratorType : Full
          SessionCount : 6
          MachineName : GBOXFCTX06

          Reply

          • Carl Webster Says:

            Apologies for the delayed response. It was Sunday and I actually took the day off the spend time with my wife and Simon and Sophie.

            If you are running the script on the same computer you ran this quick test on, then it should just work. THe script has several warnings built in. It will error out if the server is not a Collector or if Word is not installed or the required PowerShell snap-in is not installed.

            Webster

            Reply

    3. Geir Says:

      Hi. I get a message saying. Max length of Server is 10.

      Reply

      • Carl Webster Says:

        Not a problem. Just a message I put in there for when the output was not coming up right. I’ll remove it if I ever update the script again.

        Webster

        Reply

    4. George Says:

      Dear Carl

      I admire your jod and thank you.

      Please at your first convenience help me on this.

      I am running the 4.1 version of your script under 6.5 Farm, PoSH v2 and Office 2010. Script seems to be running at the moment smooth but I wonder why I cannot see the document file created in any folder.

      Reply

      • Carl Webster Says:

        Try running in 32-bit PowerShell. Several people have reported this issue on several scripts but I have never been able to reproduce it.

        Webster

        Reply

    5. Victor Says:

      Hey Carl, Victor again… I was able to run it for couple of 6.5 farms without any issue. But then I tried to run it for a XA 5 Windows 2008 farm and I am simply getting this.

      I am Citrix administrator on that farm and I am able to run Discovery and all that stuff. Do you know more specifically what the issue might be with this? Ir there a workaround or this is just a no go for the XA 5.0?

      I am using the XA52008 script version 4.2 from your downloads page.

      C:\Victor Torres\Inventory\XenApp5_2008V4.2\XA52008_Inventory_V42.ps1 : Farm information could not be retrieved. Scrip
      t cannot continue.
      At line:1 char:28
      + .\XA52008_Inventory_V42.ps1 <<<<
      + CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
      + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,XA52008_Inventory_V42.ps1

      Reply

      • Carl Webster Says:

        Did you read the ReadMe file for the 2008 script?

        If you go to a PoSH session, load the snapins and run Get-XAFarm, does it work? If not, not an issue with the script.

        Webster

        Reply

        • Victor Says:

          This is what I get when running Get-XAFarm

          I am administrator (both Citrix and local) and IMA is started, I suppose I will have to look into enabling remoting.

          Get-XAFarm Citrix commands must be executed at the Citrix server or using remoting. Make sure that your user account is a Citrix administrator and that the IMA service is started.

          Reply

    6. Victor Says:

      Hello everyone… first of all thank you very much for such wonderful job.

      Now I am not being able to run the script, I had to remove the first line which requires Powershell v3 because I cannot install v3 in the environment I am auditing. And I don’t know maybe I caused this issue but I am getting this… anyone else is having this issue?

      Unexpected token ‘4’ in expression or statement.
      At D:\Victor Torres\Inventory\XenApp65V4.25\XA65_Inventory_V42.ps1:5959 char:56
      + $ServerName = (Get-Childitem env:computername).value 4 <<<$Null
      + CategoryInfo : ParserError: (4:String) [], ParseException
      + FullyQualifiedErrorId : UnexpectedToken

      Reply

      • Carl Webster Says:

        How did you edit the file? If you used Notepad you broke the file. The file has lots of foreign characters in it which is why line 2 says to not edit the file in an ASCII editor.

        The script can be run remotely. Can you not install PoSH V3 on a domain joined PC and run the script from there?

        Webster

        Reply

        • Victor Says:

          I edited with Notepad so I broke it… I read about PoSH V3 but I am auditing this environment which is pretty tight in resources and I am external consultant so not easy for me to get a test domain machine or server 🙁

          Thanks for your quick response Carl… again awesome job!

          Reply

        • Victor Says:

          Thanks Carl!… as soon as I replied this morning I got with the IT guy and luckily they did have a test machine available.

          I was able to run the script and it worked like a charm!!!

          IT LOOKS AWESOME!!!

          Thanks again!

          Reply

    7. Patrick Dewey Says:

      Hello Carl,

      Well Citrix did it again and I cant find this link anymore..

      Before we can start using PowerShell to document anything in the XenApp 6.5 farm we first need to install the SDK (for the Help file) and Citrix Group Policy commands. From your XenApp 6.5 server, go to http://tinyurl.com/XenApp65PSSDK (Figure 2).

      Any help that you can provide would be great.

      Reply

    8. int13 Says:

      i can confirm in my our new XA64 Farm with 140 Servers runs the script very slow after 2 Minutes. Now the script runs 26 Hours. I can see the script is slow by check the server status.

      Reply

      • int13 Says:

        ok, think i have an workaround for the slow issue on my system. When the script hangs on one server check, i start MS Word manuall an close word. Now the script run normal.

        Reply

      • slon842 Says:

        Hi,
        its strange but it was taking around 20 hours to scan 20 servers for me – so i have decided to run it as a scheduled task (run as my admin account) – which lead me to another problem causing the script to hangs on “loading word templates” verbose message – as a work around I’ve created Desktop directory according to this post (http://stackoverflow.com/questions/1674836/how-to-run-a-windows-2008-task-from-the-scheduler-with-interact-with-desktop) – so when i was finaly able to run it as a task it seems to work much faster when i’m not loged in than runing it from interactive console after loging to xenapp server….

        Reply

    9. Beat Says:

      Hi, I’m realy interested in your script. Issue now, the script is running about 2 hours and only one server is done. 🙁
      Is it normal that the script is running so slow?

      Reply

      • Carl Webster Says:

        What version of the script are you running?
        Did you run with -verbose?
        Are you running on a Controller or remotely?
        What version of Word? Word 2013 is 66% slower than Word 2007 and 40% slower than Word 2010.

        Thanks

        Webster

        Reply

        • Julien Says:

          I’m running in the same problem. The document generated is very good and I would love to schedule it on a weekly basis.
          The only problem, the script takes ages to execute, but not every time.
          Sometime it takes under 10 minutes, sometimes it takes 8 hours !
          I’m using the verbose mode with or without -hardware and -software switches regardless.
          I can see it’s very slow when it starts processing “Gather session sharing info for Appendix A”.
          I’m running the script directly on my Citrix XA 6.5 server with Office 2010 installed.
          Here’s a bit of the log when it starts to get slow:

          VERBOSE: 01/28/2014 10:38:05: Processing application
          VERBOSE: 01/28/2014 10:38:05: Gather session sharing info for Appendix A
          VERBOSE: 01/28/2014 10:38:09: Max length of server name is 15
          VERBOSE: 01/28/2014 10:39:07: Move table to the right
          VERBOSE: 01/28/2014 10:39:10: Return focus back to document
          VERBOSE: 01/28/2014 10:39:26: Move to the end of the current document
          VERBOSE: 01/28/2014 10:39:33: Processing application
          VERBOSE: 01/28/2014 10:39:33: Gather session sharing info for Appendix A
          VERBOSE: 01/28/2014 10:39:38: Max length of server name is 26
          VERBOSE: 01/28/2014 10:40:36: Move table to the right
          VERBOSE: 01/28/2014 10:40:40: Return focus back to document
          VERBOSE: 01/28/2014 10:40:56: Move to the end of the current document
          VERBOSE: 01/28/2014 10:40:57: Processing application
          VERBOSE: 01/28/2014 10:40:57: Gather session sharing info for Appendix A
          VERBOSE: 01/28/2014 10:41:02: Max length of server name is 26

          Thanks in advance for your help.

          Reply

          • Carl Webster Says:

            I am aware of the issue. It has never happened to me on any of the hundreds of servers I have run the scripts on over the last three years. I have several reports of this slowness issue. I do plan on spending some time, eventually, on finding a solution. It would be nice to be able to get remote access into a server experiencing the issue and run ISE and step through the code at the slow points to see what is going on. Before the slow points the data has already been gathered and the table has been pre-created with the proper number of columns and rows. What happens next is just a simple loop that says place this piece of data from an array into this cell in the table. I have absolutely no idea why, for some people, that process can take minutes per cell.

            Thanks

            Webster

            Reply

    10. Raju Says:

      I’m receiving the error below while running the script . XenApp 6.5 farm is built in windows 2012 AD.
      WARNING: XXXXXXX is not readable by this XenApp 6.5 server
      WARNING: XXXXXXX was probably created by an updated Citrix Group Policy Provider

      Reply

      • Carl Webster Says:

        That simply means that the AD Group Policy with the name “XXXXXXX” was created by a Citrix product that your installed Citrix XenApp 6.5 Group Policy Provider does not know how to handle. That could be a XenDesktop created policy for example.

        Webster

        Reply

    11. Leon Says:

      Carl,

      I was trawling the net trying to learn some PowerShell bit and bobs to help with a proof of concept deployment I am tinkering with when I came accross your scrpit. Wow!!! you blow my mind. I ran the script against my PoC and have ended up with a document that could form the basis of a build document for future deployments.

      I just wanted to right a note and say thankyou and very well done.

      It would be interesting if the output data could be fed into MS Visio to have it automate a drawing of an infrastructure, but that is way beyond my skills.

      Cheers

      Leon (UK)

      Reply

    12. Anand Says:

      Thanks for the outstanding effort Webster!

      Can we safely run the script in Powershell V3 environment without any caveats?

      Thank you

      Reply

      • Carl Webster Says:

        I don’t believe so. I believe there are a couple of issues running the script in V3. I have not tested any of my scripts with V3.

        Webster

        Reply

    13. Chris Says:

      Thank you Mr. Webster!

      I ran the following to append my Citrix Group Policy Settings to the file.

      Import-Module .\CitrixGPOPS\Citrix.GroupPolicy.Commands.psm1
      New-PSDrive -Name CitrixGPO -PSProvider CitrixGroupPolicy -Root \ -Domain “NAME OF GPO with CITRIX SETTINGS”
      Get-CTXGroupPolicy -PolicyName “*” -DriveName CitrixGPO |out-file .\XA65Farm.txt -append
      Get-CTXGroupPolicyConfiguration -PolicyName “*” -ConfiguredOnly -DriveName CitrixGPO |out-file .\XA65Farm.txt -append
      Remove-PSDrive -Name CitrixGPO

      Reply

    14. Andrew Says:

      Hi Carl,

      Great article and amazing script – thanks for your efforts!

      One question – when I run the script, it executes and runs to completion. When it processes the policies section, it only
      returns the unfiltered policies. We have our Citrix policies stored within group policy. I am running the script from one of our ZDC’s and am unsure where I should check…

      Reply

      • Carl Webster Says:

        The script can only process Citrix IMA based policies. I have not been able to figure out how to use the Citrix provided policy module to gather data on Active Directory based polcies.

        Webster

        Reply

    15. Aresh Says:

      This is by far the best thing i have seen around XenApp by an individual outside Citrix 🙂

      Cheers

      Reply

    16. Alex Says:

      Thanks a lot Carl. I had the same type of a complete inventory script built out for our 5.0 infrastructure, and in the process of looking for 6.5 updates stumbled on your script, and since it’s so complete I won’t even need to do much of an update.
      Thanks a lot
      Alex

      Reply

    17. Yannick Says:

      Many thanks. I was struggling with listing all the servernames of a workergroup and this helped!

      Reply

    18. Sean Says:

      Hi Carl,
      Thanks for this article and scripts, very, very useful.
      Sean

      Reply

    19. Graham Says:

      Awesome!

      Reply

    20. Scott Barnwell Says:

      An amazing find, thanks for publishing this. It has saved me a lot of time on my final documentation to the client. I had to right click the psm1 files, choose properties and press the unblock button in order for them to work. Also run Set-ExecutionPolicy RemoteSigned as well.

      Reply

    21. Adam B Says:

      Carl – Just wanted to say thank you very much for this article and your hard work. Much appreciated.

      Reply

    22. yonderbox Says:

      Wow, just wow.
      You did some heavy lifting, Carl.
      Congratulations and thank you.

      Reply

    Leave a Reply to Scott Barnwell