• Documenting a Citrix XenApp 5 Farm with Microsoft PowerShell

    A customer site I was at recently needed their XenApp 5 farm documented. I remembered reading about Citrix having some PowerShell “stuff” for XenApp 5 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 2000 lines of PowerShell to thoroughly document a XenApp 5 farm.

    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 5. There is already an article for XenApp 6 and there will be an article for XenApp 6.5.

    The prerequisites to follow along with this article are:

    • A server, physical or virtual, running Microsoft Windows Server 2003 or Windows Server 2008
    • Citrix XenApp 5 for Windows Server 2003 or Windows Server 2008 installed

    My lab for this article consists of:

    • Windows Server 2008 R2 Domain Controller
    • Windows Server 2008 R2 SQL Server
    • Windows Server 2003 Standard 32-bit with XenApp 5 and HRP7
    • Windows Server 2003 Standard 64-bit with XenApp 5 and HRP7
    • Windows Server 2008 Standard 32-bit with XenApp 5 and HRP1
    • Windows Server 2008 Standard 64-bit with XenApp 5 and HRP1

    The two different XenApp 5 versions are in their own XenApp farm.

    In this article, we will be installing the Citrix XenApp Commands Technology Preview (v3).

    My initial goal was to see if I could walk down the nodes in the Delivery Services Console (Figure 1), or the Access Management Console (Figure 2), and see if I could document every nook and cranny.

    Figure 1
    Figure 1
    Figure 2
    Figure 2

    Before we can start using PowerShell to document anything in the XenApp 5 farms we first need to install the XenApp Commands Technology Preview (v3). From your XenApp 5 server, go to https://carlwebster.sharefile.com/d-sfef39096d924298b (Figure 3). Note: A MyCitrix.com login is required.

    Figure 3
    Figure 3

    Click on Download and extract the file to C:\XA5CTP. You can now close your Internet browser.

    For a 32-bit server, click Start, Run, type in C:\XA5CTP\Citrix.XenApp.Commands\Citrix.XenApp.Commands.Install_x86.msi and press Enter.

    For a 64-bit server, click Start, Run, type in C:\XA5CTP\Citrix.XenApp.Commands\Citrix.XenApp.Commands.Install_x64.msi and press Enter.

    Click Run (Figure 4).

    Figure 4
    Figure 4

    Select I accept the terms of this license agreement and click Install (Figure 5).

    Figure 5
    Figure 5

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

    Figure 6
    Figure 6

    You now have new Start Menu items under All Programs, Citrix. Windows Server 2003 is shown in and Windows Server 2008 is shown in.

    Figure 7
    Figure 7
    Figure 8
    Figure 8

    The menu item that says Windows PowerShell with XenApp Commands (CTP3) will be the one we use for this article. Click Start, All Programs, Citrix, XenApp Commands, Windows PowerShell with XenApp Commands (CTP3). A PowerShell session starts with the Citrix PowerShell modules already loaded.

    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
    

    Note: To save a lot of typing, I will refer to XenApp 5 for Windows Server 2003 as XA503 and XenApp 5 for Windows Server 2008 as XA508.

    Pasting that into the PowerShell session, gave me what is shown in Figure 9 for XA503 and Figure 10 for XA508.

    Figure 9
    Figure 9
    Figure 10
    Figure 10

    Next, I wanted to know all the information I could get. The XenApp Commands Quick Start Guide says 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 11.

    Figure 11
    Figure 11

    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 “XA”, type the following in the PowerShell session (results are shown in Figure 12):

    Get-Command --Noun XA* -Verb Get | Select-Object Name
    
    Figure 12
    Figure 12

    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. The farm name
    2. Each server’s name, product edition, and product version
    3. Each application’s name and application type.

    Typing the commands into the XA503 PowerShell session gave me the results shown in Figure 13 and Figure 14.

    Figure 13
    Figure 13
    Figure 14
    Figure 14

    My next question was how do I find out what information each command returns for me to use? That information is contained in the CTP3 Help file. Click Start, All Programs, Citrix, XenApp Commands, XenApp Commands (CTP3) Help. XA503 is shown in Figure 15 and XA508 is shown in Figure 16.

    Figure 15
    Figure 15
    Figure 16
    Figure 16

    The Citrix XenApp Commands Reference help opens (Figure 17).

    Figure 17
    Figure 17

    Double-click Commands (Figure 18).

    Figure 18
    Figure 18

    Scroll down and click on Get-XAServer (Figure 19).

    Figure 19
    Figure 19

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

    Figure 20
    Figure 20

    You see where the Return Type is a collection of XAServer objects. In the left pane, scroll down and double-click Classes (Figure 21).

    Figure 21
    Figure 21

    Scroll down and click on XAServer (Figure 22).

    Figure 22
    Figure 22

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

    Figure 23
    Figure 23

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

    I used the same processes for finding and retrieving the information for all the nodes in the Delivery Services Console (DSC) and the Access Management Console (AMC).

    My goal is to use the same wording as what is seen in the DSC and AMC 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://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
       }
    }
    

    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 5, XenApp 6.0 and XenApp 6.5. For example:

    1. Farm settings in XenApp 5 are now policy settings in XenApp 6.x
    2. Server-specific settings in XenApp 5 are now policy settings in XenApp 6.5
    3. XenApp 6.x uses Worker Groups
    4. XenApp 6.x 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.

    There are also differences between XA503 and XA508. The script will check for all the differences and for the sample script output, I will show the results from both XA503 and XA508.

    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 original script for XenApp 5
    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
       }
    }
    #Script begins
    $global:output = ""
    

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

    # Get farm information
    $farm = Get-XAFarm -EA 0
    If( $? )
    {
       #first check to make sure this is a XenApp 5 farm
       If($Farm.ServerVersion.ToString().SubString(0,1) -ne "6")
       {
         #this is a XenApp 5 farm, script can proceed
       }
       Else
       {
         #this is not a XenApp 5 farm, script cannot proceed
         write-warning "This script is designed for XenApp 5 and should not be run on XenApp 6.x"
         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
    

    In XenApp 5, we now need to get all the farm settings.

    $global:Server2008 = $False
    $global:ConfigLog = $False
    $farm = Get-XAFarmConfiguration -EA 0
    
    If( $? )
    {
    	line 0 "Farm: "$farm.FarmName
    
    	line 1 "Farm-wide"
    
    	line 2 "Connection Access Controls"
    	line 3 "Connection access controls"
    	line 4 $Farm.ConnectionAccessControls
    
    	line 2 "Connection Limits"
    	line 3 "Connections per user"
    	line 4 "Maximum connections per user: " -NoNewLine
    	If($Farm.ConnectionLimitsMaximumPerUser -eq -1)
    	{
    		line 0 "No limit set"
    	}
    	Else
    	{
    		line 0 $Farm.ConnectionLimitsMaximumPerUser
    	}
    	If($Farm.ConnectionLimitsEnforceAdministrators)
    	{
    		line 5 "Enforce limit on administrators"
    	}
    	Else
    	{
    		line 5 "Do not enforce limit on administrators"
    	}
    
    	line 4 "Logging"
    
    	If($Farm.ConnectionLimitsLogOverLimits)
    	{
    		line 5 "Log over-the-limit denials"
    	}
    	Else
    	{
    		line 5 "Do not log over-the-limit denials"
    	}
    
    	line 2 "Health Monitoring & Recovery"
    	line 3 "Limit server for load balancing"
    	line 4 "Limit servers (%): " $Farm.HmrMaximumServerPercent
    
    	line 2 "Configuration Logging"
    	If($Farm.ConfigLogEnabled)
    	{
    		$global:ConfigLog = $True
    
    		line 3 "Database configuration"
    		line 4 "Database type: " $Farm.ConfigLogDatabaseType
    		If($Farm.ConfigLogDatabaseAuthenticationMode -eq "Native")
    		{
    			line 4 "Use SQL Server authentication"
    		}
    		Else
    		{
    			line 4 "Use Windows integrated security"
    		}
    
    		line 4 "Connection String: " -NoNewLine
    
    		$StringMembers = "`n`t`t`t`t`t" + $Farm.ConfigLogDatabaseConnectionString.replace(";","`n`t`t`t`t`t")
    
    		line 4 $StringMembers -NoNewLine
    		line 0 "User name=" $Farm.ConfigLogDatabaseUserName
    
    		line 3 "Log tasks"
    		line 4 "Log administrative tasks to logging database: " $Farm.ConfigLogEnabled
    		line 5 "Disconnected database"
    		line 6 "Allow changes to the farm when database is disconnected: " $Farm.ConfigLogChangesWhileDisconnectedAllowed
    		line 3 "Clearing log"
    		line 4 "Require administrators to enter database credentials before clearing the log: " $Farm.ConfigLogCredentialsOnClearLogRequired
    	}
    	Else
    	{
    		line 3 "Configuration logging is not enabled"
    	}
    
    	line 2 "Memory/CPU"
    
    	line 3 "Exclude Applications"
    	line 4 "Applications that memory optimization ignores: "
    	If($Farm.MemoryOptimizationExcludedApplications)
    	{
    		ForEach($App in $Farm.MemoryOptimizationExcludedApplications)
    		{
    			line 5 $App
    		}
    	}
    	Else
    	{
    		line 5 "No applications are listed"
    	}
    
    	line 3 "Optimization Interval"
    	line 4 "Optimization interval: " $Farm.MemoryOptimizationScheduleType
    
    	If($Farm.MemoryOptimizationScheduleType -eq "Weekly")
    	{
    		line 5 "Day of week: " + $Farm.MemoryOptimizationScheduleDayOfWeek
    	}
    	If($Farm.MemoryOptimizationScheduleType -eq "Monthly")
    	{
    		line 5 "Day of month: " + $Farm.MemoryOptimizationScheduleDayOfMonth
    	}
    
    	line 5 "Optimization time: " $Farm.MemoryOptimizationScheduleTime
    	line 4 "Memory optimization user"
    	If($Farm.MemoryOptimizationLocalSystemAccountUsed)
    	{
    		line 4 "Use local system account"
    	}
    	Else
    	{
    		line 4 "Account: " + $Farm.MemoryOptimizationUser
    	}
    
    	line 2 "XenApp"
    	line 3 "General"
    	line 4 "Respond to client broadcast messages"
    	line 5 "Data collectors: " $Farm.RespondDataCollectors
    	line 5 "RAS servers: " $Farm.RespondRasServers
    	line 4 "Client time zones"
    	line 5 "Use client's local time: " $Farm.ClientLocalTimeEnabled
    	line 6 "Estimate local time for clients: " $Farm.ClientLocalTimeEstimationEnabled
    	line 4 "Citrix XML Service"
    	line 5 "XML Service DNS address resolution: " $Farm.DNSAddressResolution
    	line 4 "Novell Directory Services"
    	line 5 "NDS preferred tree: " -NoNewLine
    	If($Farm.NdsPreferredTree)
    	{
    		line 0 $Farm.NdsPreferredTree
    	}
    	Else
    	{
    		line 0 "No NDS Tree entered"
    	}
    	line 4 "Enable 32 bit icon color depth"
    	line 5 "Enable: " $Farm.EnhancedIconEnabled
    
    	line 3 "Shadow Policies"
    	line 4 "Shadow policies"
    	line 5 "Merge shadowers in multiple policies: " $Farm.ShadowPoliciesMerge
    
    	line 2 "HDX Broadcast"
    	line 3 "Session Reliability"
    	line 4 "Session reliability"
    	line 5 "Allow users to view sessions during broken connection: " $Farm.SessionReliabilityEnabled
    	line 5 "Port number (default 2598): " $Farm.SessionReliabilityPort
    	line 5 "Seconds to keep sessions active: " $Farm.SessionReliabilityTimeout
    
    	line 2 "Citrix Streaming Server"
    	line 3 "Log Citrix Streaming Server application events"
    	line 4 "Log application events to event log: " $Farm.StreamingLogEvents
    	line 3 "Trust Citrix Streaming Clients"
    	line 4 "Trust Citrix Delivery Clients: " $Farm.StreamingTrustCLient
    
    	line 2 "Virtual IP"
    	line 3 "Address Configuration"
    	line 4 "Virtual IP address ranges:"
    
    	$VirtualIPs = Get-XAVirtualIPRange
    	If($? -and $VirtualIPs)
    	{
    		ForEach($VirtualIP in $VirtualIPs)
    		{
    			line 5 "IP Range: " $VirtualIP
    		}
    	}
    	Else
    	{
    		line 5 "No virtual IP address range defined"
    	}
    	$VirtualIPs = $Null
    
    	line 4 "Enable logging of IP address assignment and release: " $Farm.VirtualIPLoggingEnabled
    	line 3 "Process Configuration"
    	line 4 "Virtual IP Processes"
    	If($Farm.VirtualIPProcess)
    	{
    		line 5 "Monitor the following processes:"
    		ForEach($Process in $Farm.VirtualIPProcess)
    		{
    			line 6 "Process: " $Process
    		}
    	}
    	Else
    	{
    		Line 5 "No virtual IP processes defined"
    	}
    	line 4 "Virtual Loopback Processes"
    	If($Farm.VirtualIPLoopbackProcesses)
    	{
    		line 5 "Monitor the following processes:"
    		ForEach($Process in $Farm.VirtualIPLoopbackProcesses)
    		{
    			line 6 "Process: " $Process
    		}
    	}
    	Else
    	{
    		Line 5 "No virtual IP Loopback processes defined"
    	}
    
    	line 1 "Server Default"
    	line 2 "HDX Broadcast"
    	line 3 "Auto Client Reconnect"
    	line 4 "Auto client reconnect"
    	If($Farm.AcrEnabled)
    	{
    		line 5 "Reconnect automatically"
    		line 5 "Log automatic reconnection attempts: " -NoNewLine
    
    		If($Farm.AcrLogReconnections)
    		{
    			line 0 "Enabled"
    		}
    		Else
    		{
    			line 0 "Disabled"
    		}
    	}
    	Else
    	{
    		line 5 "Require user authentication"
    	}
    
    	line 3 "Display"
    	line 4 "HDX Broadcast Display"
    	line 5 "Discard queue image"
    	line 6 "Discard queued image that is replaced by another image: " $Farm.DisplayDiscardQueuedImages
    	line 5 "Cache image"
    	line 6 "Cache image to make scrolling smoother: " $Farm.DisplayCacheImageForSmoothScrolling
    	line 5 "Maximum memory to use for each session's graphics (KB): " $Farm.DisplayMaximumGraphicsMemory
    	line 5 "Degradation bias"
    	If($Farm.DisplayDegradationBias -eq "Resolution")
    	{
    		line 6 "Degrade resolution first"
    	}
    	Else
    	{
    		line 6 "Degrade color depth first"
    	}
    	line 5 "Notify user of session degradation: " $Farm.DisplayNotifyUser
    
    	line 3 "Keep-Alive"
    	line 4 "Keep-Alive"
    	If($Farm.KeepAliveEnabled)
    	{
    		line 5 "HDX Broadcast Keep-Alive time-out value (1-3600 seconds): " $Farm.KeepAliveTimeout
    	}
    	Else
    	{
    		line 5 "HDX Broadcast Keep-Alive not enabled"
    	}
    
    	line 3 "Remote Console Connections"
    	line 4 "Remote console cOnnections"
    	line 5 "Remove connections to the console: " $Farm.RemoteConsoleEnabled
    
    	line 2 "License Server"
    	line 3 "License server"
    	line 4 "Name: " $Farm.LicenseServerName
    	line 4 "Port number (default 27000): " $Farm.LicenseServerPortNumber
    
    	line 2 "HDX Play and Play"
    	line 3 "Content Redirection"
    	line 4 "Content redirection from server to client"
    	line 5 "Content redirection from server to client: " $Farm.ContentRedirectionEnabled
    
    	line 2 "SNMP"
    	line 3 "SNMP"
    	If($Farm.SnmpEnabled)
    	{
    		line 4 "Send session traps to selected SNMP agent on all farm servers"
    		line 5 "SNMP agent session traps"
    		line 6 "Logon: " $Farm.SnmpLogonEnabled
    		line 6 "Logoff: " $Farm.SnmpLogoffEnabled
    		line 6 "Disconnect: " $Farm.SnmpDisconnectEnabled
    		line 6 "Session limit per server: " $Farm.SnmpLimitEnabled -NoNewLine
    		line 0 " " SnmpLimitPerServer
    	}
    	Else
    	{
    		line 4 "SNMP is not enabled"
    	}
    
    	line 2 "HDX 3D"
    	line 3 "Browser Acceleration"
    	line 4 "HDX 3D Browser Acceleration"
    	If($Farm.BrowserAccelerationEnabled)
    	{
    		line 5 "HDX 3D Browser Acceleration is enabled"
    		If($Farm.BrowserAccelerationCompressionEnabled)
    		{
    			line 6 "Compress JPEG images to improve bandwidth"
    			line 7 "Image compression levels: " $Farm.BrowserAccelerationCompressionLevel
    			If($Farm.BrowserAccelerationVariableImageCompression)
    			{
    				line 7 "Adjust compression level based on available bandwidth"
    			}
    			Else
    			{
    				line 7 "Do not adjust compression level based on available bandwidth"
    			}
    		}
    		Else
    		{
    			line 6 "Do not compress JPEG images to improve bandwidth"
    		}
    	}
    	Else
    	{
    		line 5 "HDX 3D Browser Acceleration is disabled"
    	}
    
    	line 2 "HDX Mediastream"
    	line 3 "Flash"
    	If($Farm.FlashAccelerationEnabled)
    	{
    		line 4 "Enable Flash for XenApp sessions"
    		line 5 "Server-side acceleration: " $Farm.FlashAccelerationOption
    	}
    	Else
    	{
    		line 4 "Flash is not enabled for XenApp sessions"
    	}
    	line 3 "Multimedia Acceleration"
    	If($Farm.MultimediaAccelerationEnabled)
    	{
    		Line 4 "Multimedia Acceleration is enabled"
    		line 5 "Multimedia Acceleration (Network buffering)"
    		If($Farm.MultimediaAccelerationDefaultBuffer)
    		{
    			line 6 "Use the default buffer of 5 seconds (recommended)"
    		}
    		Else
    		{
    			Line 6 "Custom buffer in seconds (1-10): " $Farm.MultimediaAccelerationCustomBuffer
    		}
    	}
    	Else
    	{
    		Line 4 "Multimedia Acceleration is disabled"
    	}
    
    	line 1 "Offline Access"
    	line 2 "Users"
    	If($Farm.OfflineAccounts)
    	{
    		line 3 "Configured users:"
    		ForEach($User in $Farm.OfflineAccounts)
    		{
    			line 4 $User
    		}
    	}
    	Else
    	{
    		line 3 "No users configured"
    	}
    
    	line 2 "Offline License Settings"
    	line 3 "License period (2-365 days): " $Farm.OfflineLicensePeriod
    
    }
    Else
    {
    	line 0 "Farm information could not be retrieved"
    }
    write-output $global:output
    $farm = $null
    $global:output = $null
    

     

    Sample script output from XA503:
    
    Farm: XA52003
        Farm-wide
            Connection Access Controls
                Connection access controls
                    AllowAnyConnection
            Connection Limits
                Connections per user
                    Maximum connections per user: 1
                        Do not enforce limit on administrators
                    Logging
                        Log over-the-limit denials
            Health Monitoring & Recovery
                Limit server for load balancing
                    Limit servers (%): 10
            Configuration Logging
                Database configuration
                    Database type: SqlServer
                    Use Windows integrated security
                    Connection String:
                        Server=TRAININGSQL
                        Database=XA52003ConfigLog
                        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=websterslab\administrator
                Log tasks
                    Log administrative tasks to logging database: True
                        Disconnected database
                            Allow changes to the farm when database is disconnected: True
                Clearing log
                    Require administrators to enter database credentials before clearing the log: True
            Memory/CPU
                Exclude Applications
                    Applications that memory optimization ignores:
                        No applications are listed
                Optimization Interval
                    Optimization interval: Daily
                        Optimization time: 03:00
                    Memory optimization user
                    Use local system account
            XenApp
                General
                    Respond to client broadcast messages
                        Data collectors: True
                        RAS servers: False
                    Client time zones
                        Use client's local time: True
                            Estimate local time for clients: True
                    Citrix XML Service
                        XML Service DNS address resolution: True
                    Novell Directory Services
                        NDS preferred tree: No NDS Tree entered
                    Enable 32 bit icon color depth
                        Enable: True
                Shadow Policies
                    Shadow policies
                        Merge shadowers in multiple policies: False
            HDX Broadcast
                Session Reliability
                    Session reliability
                        Allow users to view sessions during broken connection: True
                        Port number (default 2598): 2598
                        Seconds to keep sessions active: 180
            Citrix Streaming Server
                Log Citrix Streaming Server application events
                    Log application events to event log: True
                Trust Citrix Streaming Clients
                    Trust Citrix Delivery Clients: False
            Virtual IP
                Address Configuration
                    Virtual IP address ranges:
                        No virtual IP address range defined
                    Enable logging of IP address assignment and release: False
                Process Configuration
                    Virtual IP Processes
                        No virtual IP processes defined
                    Virtual Loopback Processes
                        No virtual IP Loopback processes defined
        Server Default
            HDX Broadcast
                Auto Client Reconnect
                    Auto client reconnect
                        Reconnect automatically
                        Log automatic reconnection attempts: Enabled
                Display
                    HDX Broadcast Display
                        Discard queue image
                            Discard queued image that is replaced by another image: True
                        Cache image
                            Cache image to make scrolling smoother: True
                        Maximum memory to use for each session's graphics (KB): 8192
                        Degradation bias
                            Degrade resolution first
                        Notify user of session degradation: True
                Keep-Alive
                    Keep-Alive
                        HDX Broadcast Keep-Alive time-out value (1-3600 seconds): 60
                Remote Console Connections
                    Remote console cOnnections
                        Remove connections to the console: True
            License Server
                License server
                    Name: trainingdc
                    Port number (default 27000): 27000
            HDX Play and Play
                Content Redirection
                    Content redirection from server to client
                        Content redirection from server to client: False
            SNMP
                SNMP
                    Send session traps to selected SNMP agent on all farm servers
                        SNMP agent session traps
                            Logon: True
                            Logoff: True
                            Disconnect: True
                            Session limit per server: True SnmpLimitPerServer
            HDX 3D
                Browser Acceleration
                    HDX 3D Browser Acceleration
                        HDX 3D Browser Acceleration is enabled
                            Compress JPEG images to improve bandwidth
                                Image compression levels: High
                                Adjust compression level based on available bandwidth
            HDX Mediastream
                Flash
                    Enable Flash for XenApp sessions
                        Server-side acceleration: AllConnections
                Multimedia Acceleration
                    Multimedia Acceleration is enabled
                        Multimedia Acceleration (Network buffering)
                            Use the default buffer of 5 seconds (recommended)
        Offline Access
            Users
                No users configured
            Offline License Settings
                License period (2-365 days): 21
    

    The next node in the DSC and AMC is Administrators. Administrators can have Privileges and Permissions. XA503 is shown in Figure 24 and Figure 25. XA508 is shown in Figure 26 and Figure 27.

    Figure 24
    Figure 24
    Figure 25
    Figure 25
    Figure 26
    Figure 26
    Figure 27
    Figure 27

    The Get-XAAdministrator cmdlet does not return all the information contained in the DSC or AMC. I created a custom administrator and set permissions in each of the folders. Only the Servers 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"
    		}
    		line 1 "Alert Contact Details"
    		line 2 "E-mail: " $Administrator.EmailAddress
    		line 2 "SMS Number: " $Administrator.SmsNumber
    		line 2 "SMS Gateway: " $Administrator.SmsGateway
    		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 from XA503:
    Administrators:
    
        Administrator name: WEBSTERSLAB\Administrator
        Administrator type: Full Administrator
        Administrator account is Enabled
        Alert Contact Details
            E-mail:
            SMS Number:
            SMS Gateway:
    
        Administrator name: WEBSTERSLAB\bshell
        Administrator type: ViewOnly Administrator
        Administrator account is Enabled
        Alert Contact Details
            E-mail:
            SMS Number:
            SMS Gateway:
    
        Administrator name: WEBSTERSLAB\cwebster
        Administrator type: Custom Administrator
        Administrator account is Enabled
        Alert Contact Details
            E-mail:
            SMS Number:
            SMS Gateway:
        Farm Privileges:
            EditFarmOther
            EditConfigurationLog
            EditZone
            ViewFarm
            LogOnWIConsole
            LogOnConsole
            ViewAdmins
            AssignLoadEvaluators
            EditLoadEvaluators
            ViewLoadEvaluators
            EditUserPolicies
            ViewUserPolicies
            EditOtherPrinterSettings
            EditPrinterDrivers
            EditPrinters
            ReplicatePrinterDrivers
            ViewPrintersAndDrivers
        Folder Privileges:
            Servers:
                 AssignApplications
                 ViewSessions
                 ConnectSessions
                 SendMessages
                 LogOffSessions
                 DisconnectSessions
                 ResetSessions
                 ViewServers
                 EditServerSnmpSettings
                 EditOtherServerSettings
                 RemoveServer
                 TerminateProcess
                 EditLicenseServer
            Applications:
                 ViewApplications
                 EditApplications
                 ViewSessions
                 ConnectSessions
                 SendMessages
                 LogOffSessions
                 DisconnectSessions
                 ResetSessions
                 TerminateProcessApplication
            Monitoring Profiles:
    
    Script output from XA508:
    
    Administrators:
    
        Administrator name: WEBSTERSLAB\Administrator
        Administrator type: Full Administrator
        Administrator account is Enabled
        Alert Contact Details
            E-mail:
            SMS Number:
            SMS Gateway:
    
        Administrator name: WEBSTERSLAB\bshell
        Administrator type: ViewOnly Administrator
        Administrator account is Enabled
        Alert Contact Details
            E-mail:
            SMS Number:
            SMS Gateway:
    
        Administrator name: WEBSTERSLAB\cwebster
        Administrator type: Custom Administrator
        Administrator account is Enabled
        Alert Contact Details
            E-mail:
            SMS Number:
            SMS Gateway:
        Farm Privileges:
            EditFarmOther
            EditConfigurationLog
            EditZone
            ViewFarm
            LogOnWIConsole
            LogOnConsole
            ViewAdmins
            AssignLoadEvaluators
            EditLoadEvaluators
            ViewLoadEvaluators
            EditUserPolicies
            ViewUserPolicies
            EditOtherPrinterSettings
            EditPrinterDrivers
            EditPrinters
            ReplicatePrinterDrivers
            ViewPrintersAndDrivers
        Folder Privileges:
            Servers:
                 AssignApplications
                 ViewSessions
                 ConnectSessions
                 SendMessages
                 LogOffSessions
                 DisconnectSessions
                 ResetSessions
                 ViewServers
                 EditServerSnmpSettings
                 EditOtherServerSettings
                 RemoveServer
                 TerminateProcess
                 EditLicenseServer
            Applications:
                 ViewApplications
                 EditApplications
                 ViewSessions
                 ConnectSessions
                 SendMessages
                 LogOffSessions
                 DisconnectSessions
                 ResetSessions
                 TerminateProcessApplication
    

    The next node is the applications. 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
    			}
    		}
    
    		If(!$streamedapp)
    		{
    			#location properties
    			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
    				}
    			}
    			Else
    			{
    				line 3 "Unable to retrieve a list of Servers 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
    	}
    }
    Else
    {
    	line 0 "Application information could not be retrieved"
    }
    
    $Applications = $null
    $global:output = $null
    

     

    
    Script output from XA503 only:
    
    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:
                XA520032
                XA520031
            Users:
                WEBSTERSLAB\Domain Users
            Client application folder:
            Allow connections made through AGAE: True
            Any connection: True
            File type associations:
                BATFILE
                CMDFILE
                INFFILE
                INIFILE
                TXTFILE
            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: Bits128
            Start this application without waiting for printers to be created: True
            Session window size: 1024x768
            Maximum color quality: TrueColor
    
        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:
                XA520032
                XA520031
            Users:
                WEBSTERSLAB\Domain Users
            Client application folder:
            Allow connections made through AGAE: True
            Any connection: True
            File type associations:
                PAINT.PICTURE
            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: Bits56
            Start this application without waiting for printers to be created: True
            Session window size: 800x600
            Maximum color quality: TrueColor
    

    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.

    The next node 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 "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 "TCP Address: " $server.IPAddresses
    		line 2 "Logon: " -NoNewLine
    		If($server.LogOnsEnabled)
    		{
    			line 0 "Enabled"
    		}
    		Else
    		{
    			line 0 "Disabled"
    		}
    		line 2 "Product Installation Date: " $server.CitrixInstallDate
    		line 2 "Operating System Version: " $server.OSVersion -NoNewLine
    
    		#is the server running server 2008?
    		If($server.OSVersion.ToString().SubString(0,1) -eq "6")
    		{
    			$global:Server2008 = $True
    		}
    
    		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.ICAPortNumber -gt 0)
    		{
    			line 2 "ICA Port Number: " $server.ICAPortNumber
    		}
    		$ServerConfig = Get-XAServerConfiguration -ServerName $Server.ServerName
    		If( $? )
    		{
    			line 2 "Server Configuration Data:"
    			If($ServerConfig.AcrUseFarmSettings)
    			{
    				line 3 "HDX Broadcast\Auto Client Reconnect: Server is using farm settings"
    			}
    			Else
    			{
    				line 3 "HDX Broadcast\Auto Client Reconnect: Server is not using farm settings"
    				If($ServerConfig.AcrEnabled)
    				{
    					line 4 "Reconnect automatically"
    					line 5 "Log automatic reconnection attempts: " $ServerConfig.AcrLogReconnections
    				}
    				Else
    				{
    					line 4 "Require user authentication"
    				}
    			}
    			line 3 "HDX Broadcast\Browser\Create browser listener on UDP network: " $ServerConfig.BrowserUdpListener
    			line 3 "HDX Broadcast\Browser\Server responds to client broadcast messages: " $ServerConfig.BrowserRespondToClientBroadcasts
    			If($ServerConfig.DisplayUseFarmSettings)
    			{
    				line 3 "HDX Broadcast\Display: Server is using farm settings"
    			}
    			Else
    			{
    				line 3 "HDX Broadcast\Display: Server is not using farm settings"
    				line 4 "Discard queue image\Discard queued image that is replaced by another image: " $ServerConfig.DisplayDiscardQueuedImages
    				line 4 "Cache image\Cache image to make scrolling smoother: " $ServerConfig.DisplayCacheImageForSmoothScrolling
    				line 4 "Maximum memory to use for each session's graphics (KB): " $ServerConfig.DisplayMaximumGraphicsMemory
    				line 4 "Degradation bias: " $ServerConfig.DisplayDegradationBias
    				line 4 "Display\Notify user of session degradation: " $ServerConfig.DisplayNotifyUser
    			}
    			If($ServerConfig.KeepAliveUseFarmSettings)
    			{
    				line 3 "HDX Broadcast\Keep-Alive: Server is using farm settings"
    			}
    			Else
    			{
    				line 3 "HDX Broadcast\Keep-Alive: Server is not using farm settings"
    				line 4 "HDX Broadcast Keep-Alive time-out value: " -NoNewLine
    				If($ServerConfig.KeepAliveEnabled)
    				{
    					line 0 $ServerConfig.KeepAliveTimeout
    				}
    				Else
    				{
    					line 0 "Disabled"
    				}
    			}
    			If($ServerConfig.PrinterBandwidth -eq -1)
    			{
    				line 3 "HDX Broadcast\Printer Bandwidth\Unlimited bandwidth"
    			}
    			Else
    			{
    				line 3 "HDX Broadcast\Printer Bandwidth\Limit bandwidth to use (kbps): " $ServerConfig.PrinterBandwidth
    			}
    			If($ServerConfig.RemoteConsoleUseFarmSettings)
    			{
    				line 3 "HDX Broadcast\Remote Console Connections: Server is using farm settings"
    			}
    			Else
    			{
    				line 3 "HDX Broadcast\Remote Console Connections: Server is not using farm settings"
    				line 4 "Remote connections to the console: " $ServerConfig.RemoteConsoleEnabled
    			}
    			If($ServerConfig.LicenseServerUseFarmSettings)
    			{
    				line 3 "License Server: Server is using farm settings"
    			}
    			Else
    			{
    				line 3 "License Server: Server is not using farm settings"
    				line 4 "License server name: " $ServerConfig.LicenseServerName
    				line 4 "License server port: " $ServerConfig.LicenseServerPortNumber
    			}
    			If($ServerConfig.HmrUseFarmSettings)
    			{
    				line 3 "Health Monitoring & Recovery: Server is using farm settings"
    			}
    			Else
    			{
    				line 3 "Health Monitoring & Recovery: Server is not using farm settings"
    				line 4 "Run health monitoring tests on this server: " $ServerConfig.HmrEnabled
    				If($ServerConfig.HmrEnabled)
    				{
    					$HMRTests = Get-XAHmrTest -ServerName $Server.ServerName -EA 0
    					If( $? )
    					{
    						line 4 "Health Montoring Tests:"
    						ForEach($HMRTest in $HMRTests)
    						{
    							line 5 "Name      : " $HMRTest.TestName
    							line 5 "Interval    : " $HMRTest.Interval
    							line 5 "Threshold    : " $HMRTest.Threshold
    							line 5 "Time-out    : " $HMRTest.Timeout
    							line 5 "Test File Name : " $HMRTest.FilePath
    							line 5 "Recovery Action : " $HMRTest.RecoveryAction
    							line 5 "Test Description: " $HMRTest.Description
    							line 5 ""
    						}
    					}
    					Else
    					{
    						line 0 "Health Monitoring & Reporting data could not be retrieved for server " $Server.ServerName
    					}
    				}
    			}
    			If($ServerConfig.CpuUseFarmSettings)
    			{
    				line 3 "CPU Utilization Management: Server is using farm settings"
    			}
    			Else
    			{
    				line 3 "CPU Utilization Management: Server is not using farm settings"
    				line 4 "CPU Utilization Management: " $ServerConfig.CpuManagementLevel
    			}
    			If($ServerConfig.MemoryUseFarmSettings)
    			{
    				line 3 "Memory Optimization: Server is using farm settings"
    			}
    			Else
    			{
    				line 3 "Memory Optimization: Server is not using farm settings"
    				line 4 "Memory Optimization: " $ServerConfig.MemoryOptimizationEnabled
    			}
    			If($ServerConfig.ContentRedirectionUseFarmSettings )
    			{
    				line 3 "HDX Plug and Play/Content Redirection: Server is using farm settings"
    			}
    			Else
    			{
    				line 3 "HDX Plug and Play/Content Redirection: Server is not using farm settings"
    				line 4 "Content redirection from server to client: " $ServerConfig.ContentRedirectionEnabled
    			}
    			line 3 "HDX Plug and Play/Shadow Logging/Log shadowing sessions: " $ServerConfig.ShadowLoggingEnabled
    			If($ServerConfig.SnmpUseFarmSettings )
    			{
    				line 3 "SNMP: Server is using farm settings"
    			}
    			Else
    			{
    				line 3 "SNMP: Server is not using farm settings"
    				# SnmpEnabled is not working
    				line 4 "Send session traps to selected SNMP agent on all farm servers: " $ServerConfig.SnmpEnabled
    				If( $ServerConfig.SnmpEnabled )
    				{
    					line 5 "SNMP agent session traps:"
    					line 6 "Logon          : " $ServerConfig.SnmpLogOnEnabled
    					line 6 "Logoff         : " $ServerConfig.SnmpLogOffEnabled
    					line 6 "Disconnect       : " $ServerConfig.SnmpDisconnectEnabled
    					line 6 "Session limit per server: " $ServerConfig.SnmpLimitEnabled -NoNewLine
    					line 0 " " $ServerConfig.SnmpLimitPerServer
    				}
    			}
    			If($ServerConfig.BrowserAccelerationUseFarmSettings )
    			{
    				line 3 "HDX 3D/Browser Acceleration: Server is using farm settings"
    			}
    			Else
    			{
    				line 3 "HDX 3D/Browser Acceleration: Server is not using farm settings"
    				line 4 "HDX 3D/Browser Acceleration: " $ServerConfig.BrowserAccelerationEnabled
    				If($ServerConfig.BrowserAccelerationEnabled)
    				{
    					line 5 "Compress JPEG images to improve bandwidth: " $ServerConfig.BrowserAccelerationCompressionEnabled
    					If($ServerConfig.BrowserAccelerationCompressionEnabled)
    					{
    						line 6 "Image compression level: " $ServerConfig.BrowserAccelerationCompressionLevel
    						line 6 "Adjust compression level based on available bandwidth: " $ServerConfig.BrowserAccelerationVariableImageCompression
    					}
    				}
    			}
    			If($ServerConfig.FlashAccelerationUseFarmSettings )
    			{
    				line 3 "HDX MediaStream/Flash: Server is using farm settings"
    			}
    			Else
    			{
    				line 3 "HDX MediaStream/Flash: Server is not using farm settings"
    				line 4 "Enable Flash for XenApp sessions: " $ServerConfig.FlashAccelerationEnabled
    				If($ServerConfig.FlashAccelerationEnabled)
    				{
    					line 5 "Server-side acceleration: " $ServerConfig.FlashAccelerationOption
    				}
    			}
    			If($ServerConfig.MultimediaAccelerationUseFarmSettings )
    			{
    				line 3 "HDX MediaStream/Multimedia Acceleration: Server is using farm settings"
    			}
    			Else
    			{
    				line 3 "HDX MediaStream/Multimedia Acceleration: Server is not using farm settings"
    				line 4 "Multimedia acceleration: " $ServerConfig.MultimediaAccelerationEnabled
    				If($ServerConfig.MultimediaAccelerationEnabled)
    				{
    					If($ServerConfig.MultimediaAccelerationDefaultBuffer)
    					{
    						line 5 "Use the default buffer of 5 seconds"
    					}
    					Else
    					{
    						line 5 "Custom buffer in seconds: " $ServerConfig.MultimediaAccelerationCustomBuffer
    					}
    				}
    			}
    			line 3 "Virtual IP/Enable virtual IP for this server: " $ServerConfig.VirtualIPEnabled
    			line 3 "Virtual IP/Use farm setting for IP address logging: " $ServerConfig.VirtualIPUseFarmLoggingSettings
    			line 3 "Virtual IP/Enable logging of IP address assignment and release on this server: " $ServerConfig.VirtualIPLoggingEnabled
    			line 3 "Virtual IP/Enable virtual loopback for this server: " $ServerConfig.VirtualIPLoopbackEnabled
    			line 3 "XML Service/Trust requests sent to the XML service: " $ServerConfig.XmlServiceTrustRequests
    		}
    		Else
    		{
    			line 0 "Server configuration data could not be retrieved for server " $Server.ServerName
    		}
    		#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 from XA503:
    
    Servers:
    		Name: XA520031
    				Product: Citrix Presentation Server, Platinum Edition
    				Version: 4.6.3600
    				Service Pack: 2006.10
    				Operating System Type: 32 bit
    				TCP Address: 192.168.1.102
    				Logon: Enabled
    				Product Installation Date: 10/01/2011 07:23:58
    				Operating System Version: 5.2.3790 Service Pack 2
    				Zone: 192.168.1.0
    				Election Preference: MostPreferred
    				Folder: Servers
    				Product Installation Path: C:\Program Files\Citrix\
    				ICA Port Number: 1494
    				Server Configuration Data:
    						HDX Broadcast\Auto Client Reconnect: Server is using farm settings
    						HDX Broadcast\Browser\Create browser listener on UDP network: True
    						HDX Broadcast\Browser\Server responds to client broadcast messages: False
    						HDX Broadcast\Display: Server is using farm settings
    						HDX Broadcast\Keep-Alive: Server is using farm settings
    						HDX Broadcast\Printer Bandwidth\Unlimited bandwidth
    						HDX Broadcast\Remote Console Connections: Server is using farm settings
    						License Server: Server is using farm settings
    						Health Monitoring & Recovery: Server is using farm settings
    						CPU Utilization Management: Server is using farm settings
    						Memory Optimization: Server is using farm settings
    						HDX Plug and Play/Content Redirection: Server is using farm settings
    						HDX Plug and Play/Shadow Logging/Log shadowing sessions:
    						SNMP: Server is using farm settings
    						HDX 3D/Browser Acceleration: Server is using farm settings
    						HDX MediaStream/Flash: Server is using farm settings
    						HDX MediaStream/Multimedia Acceleration: Server is using farm settings
    						Virtual IP/Enable virtual IP for this server: False
    						Virtual IP/Use farm setting for IP address logging: True
    						Virtual IP/Enable logging of IP address assignment and release on this server: False
    						Virtual IP/Enable virtual loopback for this server: False
    						XML Service/Trust requests sent to the XML service: False
    						Published applications:
    
    								Display name: Notepad
    								Folder path: Applications
    
    								Display name: Paint
    								Folder path: Applications
    
    						Citrix Hotfixes:
    
    								Hotfix: PSE450W2K3R05
    								Installed by: WEBSTERSLAB\Administrator
    								Installed date: 09/30/2011 21:25:49
    								Hotfix type: HRP
    								Valid: False
    								Hotfixes replaced:
    										PSE450R03W2K3030
    										PSE450W2K3005
    										PSE450R04W2K3025
    										PSE450W2K3R04
    
    										PSE450W2K3006
    										PSE450R04W2K3030
    										PSE450R02W2K3036
    
    								Hotfix: PSE450W2K3R07
    								Installed by: WEBSTERSLAB\Administrator
    								Installed date: 09/30/2011 21:55:37
    								Hotfix type: HRP
    								Valid: True
    								Hotfixes replaced:
    										PSE450R01W2K3001
    										PSE450R01W2K3002
    										PSE450R01W2K3003
    										PSE450R01W2K3004
    
    										PSE450W2K3R05
    										PSE450W2K3R06
    										PSE450R03W2K3WS
    
    		Name: XA520032
    				Product: Citrix Presentation Server, Platinum Edition
    				Version: 4.6.3600
    				Service Pack: 2006.10
    				Operating System Type: 64 bit
    				TCP Address: 192.168.1.103
    				Logon: Enabled
    				Product Installation Date: 10/01/2011 07:30:49
    				Operating System Version: 5.2.3790 Service Pack 2
    				Zone: 192.168.1.0
    				Election Preference: DefaultPreference
    				Folder: Servers
    				Product Installation Path: C:\Program Files (x86)\Citrix\
    				ICA Port Number: 1494
    				Server Configuration Data:
    						HDX Broadcast\Auto Client Reconnect: Server is using farm settings
    						HDX Broadcast\Browser\Create browser listener on UDP network: True
    						HDX Broadcast\Browser\Server responds to client broadcast messages: False
    						HDX Broadcast\Display: Server is using farm settings
    						HDX Broadcast\Keep-Alive: Server is using farm settings
    						HDX Broadcast\Printer Bandwidth\Limit bandwidth to use (kbps): 300
    						HDX Broadcast\Remote Console Connections: Server is using farm settings
    						License Server: Server is using farm settings
    						Health Monitoring & Recovery: Server is using farm settings
    						CPU Utilization Management: Server is using farm settings
    						Memory Optimization: Server is using farm settings
    						HDX Plug and Play/Content Redirection: Server is using farm settings
    						HDX Plug and Play/Shadow Logging/Log shadowing sessions:
    						SNMP: Server is not using farm settings
    								Send session traps to selected SNMP agent on all farm servers:
    						HDX 3D/Browser Acceleration: Server is using farm settings
    						HDX MediaStream/Flash: Server is using farm settings
    						HDX MediaStream/Multimedia Acceleration: Server is using farm settings
    						Virtual IP/Enable virtual IP for this server: False
    						Virtual IP/Use farm setting for IP address logging: True
    						Virtual IP/Enable logging of IP address assignment and release on this server: False
    						Virtual IP/Enable virtual loopback for this server: False
    						XML Service/Trust requests sent to the XML service: True
    						Published applications:
    
    								Display name: Notepad
    								Folder path: Applications
    
    								Display name: Paint
    								Folder path: Applications
    
    						Citrix Hotfixes:
    
    								Hotfix: PSE450W2K3X64R05
    								Installed by: WEBSTERSLAB\Administrator
    								Installed date: 09/30/2011 21:31:58
    								Hotfix type: HRP
    								Valid: False
    								Hotfixes replaced:
    										PSE450R01W2K3X64006
    										PSE450R01W2K3X64032
    										PSE450R01W2K3X64030
    										PSE450R02W2K3X64027
    
    										PSE450R04W2K3X64014
    										PSE450R04W2K3X64015
    										PSE450W2K3X64R04
    
    										Hotfix: PSE450W2K3X64R07
    										Installed by: WEBSTERSLAB\Administrator
    										Installed date: 09/30/2011 21:57:32
    										Hotfix type: HRP
    										Valid: True
    										Hotfixes replaced:
    												PSE450R01W2K3X64001
    												PSE450R01W2K3X64002
    												PSE450R01W2K3X64003
    												PSE450R01W2K3X64004
    
    												PSE450W2K3X64R04
    												PSE450W2K3X64R05
    												PSE450W2K3X64R06
    
    Script output from XA508:
    
    Servers:
    
        Name: XA520081
            Product: Citrix Presentation Server, Platinum Edition
            Version: 5.0.5357
            Service Pack: 0
            Operating System Type: 32 bit
            TCP Address: 192.168.1.104
            Logon: Enabled
            Product Installation Date: 10/01/2011 08:27:59
            Operating System Version: 6.0.6002 Service Pack 2
            Zone: Default Zone
            Election Preference: DefaultPreference
            Folder: Servers
            Product Installation Path: C:\Program Files\Citrix\
            ICA Port Number: 1494
            Server Configuration Data:
                HDX Broadcast\Auto Client Reconnect: Server is using farm settings
                HDX Broadcast\Browser\Create browser listener on UDP network: True
                HDX Broadcast\Browser\Server responds to client broadcast messages: False
                HDX Broadcast\Display: Server is using farm settings
                HDX Broadcast\Keep-Alive: Server is using farm settings
                HDX Broadcast\Printer Bandwidth\Unlimited bandwidth
                HDX Broadcast\Remote Console Connections: Server is using farm settings
                License Server: Server is using farm settings
                Health Monitoring & Recovery: Server is using farm settings
                CPU Utilization Management: Server is using farm settings
                Memory Optimization: Server is using farm settings
                HDX Plug and Play/Content Redirection: Server is using farm settings
                HDX Plug and Play/Shadow Logging/Log shadowing sessions:
                SNMP: Server is using farm settings
                HDX 3D/Browser Acceleration: Server is using farm settings
                HDX MediaStream/Flash: Server is using farm settings
                HDX MediaStream/Multimedia Acceleration: Server is using farm settings
                Virtual IP/Enable virtual IP for this server: False
                Virtual IP/Use farm setting for IP address logging: True
                Virtual IP/Enable logging of IP address assignment and release on this server: False
                Virtual IP/Enable virtual loopback for this server: False
                XML Service/Trust requests sent to the XML service: False
    
        Name: XA520082
            Product: Citrix Presentation Server, Platinum Edition
            Version: 5.0.5357
            Service Pack: 0
            Operating System Type: 64 bit
            TCP Address: 192.168.1.105
            Logon: Enabled
            Product Installation Date: 10/01/2011 08:24:54
            Operating System Version: 6.0.6002 Service Pack 2
            Zone: Default Zone
            Election Preference: MostPreferred
            Folder: Servers
            Product Installation Path: C:\Program Files (x86)\Citrix\
            ICA Port Number: 1494
            Server Configuration Data:
                HDX Broadcast\Auto Client Reconnect: Server is using farm settings
                HDX Broadcast\Browser\Create browser listener on UDP network: True
                HDX Broadcast\Browser\Server responds to client broadcast messages: False
                HDX Broadcast\Display: Server is using farm settings
                HDX Broadcast\Keep-Alive: Server is using farm settings
                HDX Broadcast\Printer Bandwidth\Unlimited bandwidth
                HDX Broadcast\Remote Console Connections: Server is using farm settings
                License Server: Server is using farm settings
                Health Monitoring & Recovery: Server is using farm settings
                CPU Utilization Management: Server is using farm settings
                Memory Optimization: Server is using farm settings
                HDX Plug and Play/Content Redirection: Server is using farm settings
                HDX Plug and Play/Shadow Logging/Log shadowing sessions:
                SNMP: Server is using farm settings
                HDX 3D/Browser Acceleration: Server is using farm settings
                HDX MediaStream/Flash: Server is using farm settings
                HDX MediaStream/Multimedia Acceleration: Server is using farm settings
                Virtual IP/Enable virtual IP for this server: False
                Virtual IP/Use farm setting for IP address logging: True
                Virtual IP/Enable logging of IP address assignment and release on this server: False
                Virtual IP/Enable virtual loopback for this server: False
                XML Service/Trust requests sent to the XML service: False
    

    Next up, 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
    	}
    }
    Else
    {
    	line 0 "Zone information could not be retrieved"
    }
    $Servers = $null
    $Zone = $null
    $global:output = $null
    

     

    Script output:
    
    Zones:
    
    		Zone Name: 192.168.1.0
    				Current Data Collector: XA520031
    				Servers in Zone
    						Server Name and Preference: XA520031 MostPreferred
    						Server Name and Preference: XA520032 DefaultPreference
    

    There are no Citrix supplied PowerShell commands for the Monitoring Configuration node for XA503.

    We have now finished the DSC and AMC so it is time to start working through the Advanced Configuration Console (ACC). Citrix does not provide any PowerShell commands for processing Installation Manager, Isolation Environments or Resource Manager in XA503. The Applications and Server nodes have already been done. That leaves us with Load Evaluators, Policies and Printer Management.

    First up in the ACC is 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 3 "client connections from the listed IP Ranges"
    			ForEach($IPRange in $LoadEvaluator.IPRanges)
    			{
    				line 4 "IP Address Ranges: " $IPRange
    			}
    		}
    
    		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
    		}
    
    		line 0 ""
    		write-output $global:output
    		$global:output = $null
    	}
    
    }
    Else
    {
    	line 0 "Load Evaluator information could not be retrieved"
    }
    $LoadEvaluators = $null
    $global:output = $null
    

     

    Sample script output from XA503 only:
    
    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
    				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
    

    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. Plus there are some policies only for XA508 and some of the same settings for XA503 and XA508 have different names and descriptions.

    $Policies = Get-XAPolicy -EA 0 | sort-object PolicyName
    If( $? -and $Policies)
    {
    	line 0 ""
    	line 0 "Policies:"
    	ForEach($Policy in $Policies)
    	{
    		line 1 "Policy Name: " $Policy.PolicyName
    		line 2 "Description: " $Policy.Description
    		line 2 "Enabled: " $Policy.Enabled
    		line 2 "Priority: " $Policy.Priority
    
    		$filter = Get-XAPolicyFilter -PolicyName $Policy.PolicyName -EA 0
    
    		If( $? )
    		{
    			If($Filter)
    			{
    				line 2 "Policy Filters:"
    
    				If($Filter.AccessControlEnabled)
    				{
    					If($Filter.AllowConnectionsThroughAccessGateway)
    					{
    						line 3 "Apply to connections made through Access Gateway"
    						If($Filter.AccessSessionConditions)
    						{
    							line 4 "Any connection that meets any of the following filters"
    							ForEach($Condition in $Filter.AccessSessionConditions)
    							{
    								$Colon = $Condition.IndexOf(":")
    								$CondName = $Condition.SubString(0,$Colon)
    								$CondFilter = $Condition.SubString($Colon+1)
    								Line 5 "Access Gateway Farm Name: " $CondName -NoNewLine
    								Line 0 " Filter Name: " $CondFilter
    							}
    						}
    						Else
    						{
    							line 4 "Any connection"
    						}
    						line 4 "Apply to all other connections: " $Filter.AllowOtherConnections
    					}
    					Else
    					{
    						line 3 "Do not apply to connections made through Access Gateway"
    					}
    				}
    				If($Filter.ClientIPAddressEnabled)
    				{
    					line 3 "Apply to all client IP addresses: " $Filter.ApplyToAllClientIPAddresses
    					If($Filter.AllowedIPAddresses)
    					{
    						line 3 "Allowed IP Addresses:"
    						ForEach($Allowed in $Filter.AllowedIPAddresses)
    						{
    							line 4 $Allowed
    						}
    					}
    					If($Filter.DeniedIPAddresses)
    					{
    						line 3 "Denied IP Addresses:"
    						ForEach($Denied in $Filter.DeniedIPAddresses)
    						{
    							line 4 $Denied
    						}
    					}
    				}
    				If($Filter.ClientNameEnabled)
    				{
    					line 3 "Apply to all client names: " $Filter.ApplyToAllClientNames
    					If($Filter.AllowedClientNames)
    					{
    						line 3 "Allowed Client Names:"
    						ForEach($Allowed in $Filter.AllowedClientNames)
    						{
    							line 4 $Allowed
    						}
    					}
    					If($Filter.DeniedClientNames)
    					{
    						line 3 "Denied Client Names:"
    						ForEach($Denied in $Filter.DeniedClientNames)
    						{
    							line 4 $Denied
    						}
    					}
    				}
    				If($Filter.ServerEnabled)
    				{
    					If($Filter.AllowedServerNames)
    					{
    						line 3 "Allowed Server Names:"
    						ForEach($Allowed in $Filter.AllowedServerNames)
    						{
    							line 4 $Allowed
    						}
    					}
    					If($Filter.DeniedServerNames)
    					{
    						line 3 "Denied Server Names:"
    						ForEach($Denied in $Filter.DeniedServerNames)
    						{
    							line 4 $Denied
    						}
    					}
    					If($Filter.AllowedServerFolders)
    					{
    						line 3 "Allowed Server Folders:"
    						ForEach($Allowed in $Filter.AllowedServerFolders)
    						{
    							line 4 $Allowed
    						}
    					}
    					If($Filter.DeniedServerFolders)
    					{
    						line 3 "Denied Server Folders:"
    						ForEach($Denied in $Filter.DeniedServerFolders)
    						{
    							line 4 $Denied
    						}
    					}
    				}
    				If($Filter.AccountEnabled)
    				{
    					line 3 "Apply to all explicit (non-anonymous) users: " $Filter.ApplyToAllExplicitAccounts
    					line 3 "Apply to anonymous users: " $Filter.ApplyToAnonymousAccounts
    					If($Filter.AllowedAccounts)
    					{
    						line 3 "Allowed Accounts:"
    						ForEach($Allowed in $Filter.AllowedAccounts)
    						{
    							line 4 $Allowed
    						}
    					}
    					If($Filter.DeniedAccounts)
    					{
    						line 3 "Denied Accounts:"
    						ForEach($Denied in $Filter.DeniedAccounts)
    						{
    							line 4 $Denied
    						}
    					}
    				}
    			}
    			Else
    			{
    				line 2 "No filter information"
    			}
    		}
    		Else
    		{
    			Line 2 "Unable to retrieve Filter settings"
    		}
    
    		$Settings = Get-XAPolicyConfiguration -PolicyName $Policy.PolicyName -EA 0
    
    		If( $? )
    		{
    			line 2 "Policy Settings:"
    			ForEach($Setting in $Settings)
    			{
    				#HDX 3D
    				If($Setting.ImageAccelerationState -ne "NotConfigured")
    				{
    					line 3 "HDX 3D\Progressive Display\Progressive Display: " $Setting.ImageAccelerationState
    					If($Setting.ImageAccelerationState -eq "Enabled")
    					{
    						line 3 "HDX 3D\Progressive Display\Progressive Display\Compression level: " $Setting.ImageAccelerationCompressionLevel
    						line 3 "HDX 3D\Progressive Display\Progressive Display\Compression level\Restrict compression to connections under this bandwidth: " $Setting.ImageAccelerationCompressionIsRestricted
    						If($Setting.ImageAccelerationCompressionIsRestricted)
    						{
    							line 3 "HDX 3D\Progressive Display\Progressive Display\Compression level\Restrict compression to connections under this bandwidth\Threshhold (Kb/sec): " $Setting.ImageAccelerationCompressionLimit
    						}
    						line 3 "HDX 3D\Progressive Display\Progressive Display\SpeedScreen Progressive Display compression level: " $Setting.ImageAccelerationProgressiveLevel
    						line 3 "HDX 3D\Progressive Display\Progressive Display\Restrict compression to connections under this bandwidth: " $Setting.ImageAccelerationProgressiveIsRestricted
    						If($Setting.ImageAccelerationProgressiveIsRestricted)
    						{
    							line 3 "HDX 3D\Progressive Display\Progressive Display\Restrict compression to connections under this bandwidth\Threshhold (Kb/sec): " $Setting.ImageAccelerationProgressiveLimit
    						}
    						line 3 "HDX 3D\Progressive Display\Progressive Display\Use Heavyweight compression (extra CPU, retains quality): " $Setting.ImageAccelerationIsHeavyweightUsed
    					}
    				}
    
    				#HDX Broadcast
    				If($Setting.TurnWallpaperOffState -ne "NotConfigured")
    				{
    					line 3 "HDX Broadcast\Visual Effects\Turn off desktop wallpaper: " $Setting.TurnWallpaperOffState
    					If($Setting.TurnWallpaperOffState -eq "Enabled")
    					{
    						line 3 "HDX Broadcast\Visual Effects\Turn off desktop wallpaper\Turn Off Desktop Wallpaper"
    					}
    				}
    
    				#menu animation 2008 only
    				If($global:Server2008)
    				{
    					If($Setting.TurnMenuAnimationsOffState -ne "NotConfigured")
    					{
    						line 3 "HDX Broadcast\Visual Effects\Turn off menu animations: " $Setting.TurnMenuAnimationsOffState
    						If($Setting.TurnMenuAnimationsOffState -eq "Enabled")
    						{
    							line 3 "HDX Broadcast\Visual Effects\Turn off menu animations\Turn Off Menu and Window Animations"
    						}
    					}
    				}
    				If($Setting.TurnWindowContentsOffState -ne "NotConfigured")
    				{
    					line 3 "HDX Broadcast\Visual Effects\Turn off window contents while dragging: " $Setting.TurnWindowContentsOffState
    					If($Setting.TurnWindowContentsOffState -eq "Enabled")
    					{
    						line 3 "HDX Broadcast\Visual Effects\Turn off window contents while dragging\Turn Off Windows Contents While Dragging"
    					}
    				}
    				If($Setting.SessionAudioState -ne "NotConfigured")
    				{
    					line 3 "Session Limits\Audio: " $Setting.SessionAudioState
    					If($Setting.SessionAudioState -eq "Enabled")
    					{
    						line 3 "Session Limits\Audio\Limit (Kb/sec): " $Setting.SessionAudioLimit
    					}
    				}
    				If($Setting.SessionClipboardState -ne "NotConfigured")
    				{
    					line 3 "Session Limits\Clipboard: " $Setting.SessionClipboardState
    					If($Setting.SessionClipboardState -eq "Enabled")
    					{
    						line 3 "Session Limits\Clipboard\Limit (Kb/sec): " $Setting.SessionClipboardLimit
    					}
    				}
    				If($Setting.SessionComportsState -ne "NotConfigured")
    				{
    					line 3 "Session Limits\COM Ports: " $Setting.SessionComportsState
    					If($Setting.SessionComportsState -eq "Enabled")
    					{
    						line 3 "Session Limits\COM Ports\Limit (Kb/sec): " $Setting.SessionComportsLimit
    					}
    				}
    				If($Setting.SessionDrivesState -ne "NotConfigured")
    				{
    					line 3 "Session Limits\Drives: " $Setting.SessionDrivesState
    					If($Setting.SessionDrivesState -eq "Enabled")
    					{
    						line 3 "Session Limits\Drives\Limit (Kb/sec): " $Setting.SessionDrivesLimit
    					}
    				}
    				If($Setting.SessionLptPortsState -ne "NotConfigured")
    				{
    					line 3 "Session Limits\LPT Ports: " $Setting.SessionLptPortsState
    					If($Setting.SessionLptPortsState -eq "Enabled")
    					{
    						line 3 "Session Limits\LPT Ports\Limit (Kb/sec): " $Setting.SessionLptPortsLimit
    					}
    				}
    				If($Setting.SessionOemChannelsState -ne "NotConfigured")
    				{
    					line 3 "Session Limits\OEM Virtual Channels: " $Setting.SessionOemChannelsState
    					If($Setting.SessionOemChannelsState -eq "Enabled")
    					{
    						line 3 "Session Limits\OEM Virtual Channels\Limit (Kb/sec): " $Setting.SessionOemChannelsLimit
    					}
    				}
    				If($Setting.SessionOverallState -ne "NotConfigured")
    				{
    					line 3 "Session Limits\Overall Session: " $Setting.SessionOverallState
    					If($Setting.SessionOverallState -eq "Enabled")
    					{
    						line 3 "Session Limits\Overall Session\Limit (Kb/sec): " $Setting.SessionOverallLimit
    					}
    				}
    				If($Setting.SessionPrinterBandwidthState -ne "NotConfigured")
    				{
    					line 3 "Session Limits\Printer: " $Setting.SessionPrinterBandwidthState
    					If($Setting.SessionPrinterBandwidthState -eq "Enabled")
    					{
    						line 3 "Session Limits\Printer\Limit (Kb/sec): " $Setting.SessionPrinterBandwidthLimit
    					}
    				}
    				If($Setting.SessionTwainRedirectionState -ne "NotConfigured")
    				{
    					line 3 "Session Limits\TWAIN Redirection: " $Setting.SessionTwainRedirectionState
    					If($Setting.SessionTwainRedirectionState -eq "Enabled")
    					{
    						line 3 "Session Limits\TWAIN Redirection\Limit (Kb/sec): " $Setting.SessionTwainRedirectionLimit
    					}
    				}
    
    				#Session Limits % Server 2008 only
    				If($global:Server2008)
    				{
    					If($Setting.SessionAudioPercentState -ne "NotConfigured")
    					{
    						line 3 'Session Limits (%)\Audio: ' $Setting.SessionAudioPercentState
    						If($Setting.SessionAudioPercentState -eq "Enabled")
    						{
    							line 3 'Session Limits (%)\Audio\Limit (%): ' $Setting.SessionAudioPercentLimit
    						}
    					}
    					If($Setting.SessionClipboardPercentState -ne "NotConfigured")
    					{
    						line 3 "Session Limits (%)\Clipboard: " $Setting.SessionClipboardPercentState
    						If($Setting.SessionClipboardPercentState -eq "Enabled")
    						{
    							line 3 'Session Limits (%)\Clipboard\Limit (%): ' $Setting.SessionClipboardPercentLimit
    						}
    					}
    					If($Setting.SessionComportsPercentState -ne "NotConfigured")
    					{
    						line 3 "Session Limits (%)\COM Ports: " $Setting.SessionComportsPercentState
    						If($Setting.SessionComportsPercentState -eq "Enabled")
    						{
    							line 3 'Session Limits (%)\COM Ports\Limit (%): ' $Setting.SessionComportsPercentLimit
    						}
    					}
    					If($Setting.SessionDrivesPercentState -ne "NotConfigured")
    					{
    						line 3 "Session Limits (%)\Drives: " $Setting.SessionDrivesPercentState
    						If($Setting.SessionDrivesPercentState -eq "Enabled")
    						{
    							line 3 'Session Limits (%)\Drives\Limit (%): ' $Setting.SessionDrivesPercentLimit
    						}
    					}
    					If($Setting.SessionLptPortsPercentState -ne "NotConfigured")
    					{
    						line 3 "Session Limits (%)\LPT Ports: " $Setting.SessionLptPortsPercentState
    						If($Setting.SessionLptPortsPercentState -eq "Enabled")
    						{
    							line 3 'Session Limits (%)\LPT Ports\Limit (%): ' $Setting.SessionLptPortsPercentLimit
    						}
    					}
    					If($Setting.SessionOemChannelsPercentState -ne "NotConfigured")
    					{
    						line 3 "Session Limits (%)\OEM Virtual Channels: " $Setting.SessionOemChannelsPercentState
    						If($Setting.SessionOemChannelsPercentState -eq "Enabled")
    						{
    							line 3 'Session Limits (%)\OEM Virtual Channels\Limit (%): ' $Setting.SessionOemChannelsPercentLimit
    						}
    					}
    					If($Setting.SessionPrinterPercentState -ne "NotConfigured")
    					{
    						line 3 "Session Limits (%)\Printer: " $Setting.SessionPrinterPercentState
    						If($Setting.SessionPrinterPercentState -eq "Enabled")
    						{
    							line 3 'Session Limits (%)\Printer\Limit (%): ' $Setting.SessionPrinterPercentLimit
    						}
    					}
    					If($Setting.SessionTwainRedirectionPercentState -ne "NotConfigured")
    					{
    						line 3 "Session Limits (%)\TWAIN Redirection: " $Setting.SessionTwainRedirectionPercentState
    						If($Setting.SessionTwainRedirectionPercentState -eq "Enabled")
    						{
    							line 3 'Session Limits (%)\TWAIN Redirection\Limit (%): ' $Setting.SessionTwainRedirectionPercentLimit
    						}
    					}
    				}
    
    				#HDX Plug-n-Play
    				If($Setting.ClientMicrophonesState -ne "NotConfigured")
    				{
    					line 3 "HDX Plug-n-Play\Client Resources\Audio\Microphones: " $Setting.ClientMicrophonesState
    					If($Setting.ClientMicrophonesState -eq "Enabled")
    					{
    						If($Setting.ClientMicrophonesAreUsed)
    						{
    							line 3 "HDX Plug-n-Play\Client Resources\Audio\Microphones\Use client microphones for audio input"
    						}
    						Else
    						{
    							line 3 "HDX Plug-n-Play\Client Resources\Audio\Microphones\Do not use client microphones for audio input"
    						}
    					}
    				}
    				If($Setting.ClientSoundQualityState -ne "NotConfigured")
    				{
    					line 3 "HDX Plug-n-Play\Client Resources\Sound quality: " $Setting.ClientSoundQualityState
    					If($Setting.ClientSoundQualityState)
    					{
    						line 3 "HDX Plug-n-Play\Client Resources\Sound quality\Maximum allowable client audio quality: " $Setting.ClientSoundQualityLevel
    					}
    				}
    				If($Setting.TurnClientAudioMappingOffState -ne "NotConfigured")
    				{
    					line 3 "HDX Plug-n-Play\Client Resources\Turn off speakers: " $Setting.TurnClientAudioMappingOffState
    					If($Setting.TurnClientAudioMappingOffState -eq "Enabled")
    					{
    						line 3 "HDX Plug-n-Play\Client Resources\Turn off speakers\Turn off audio mapping to client speakers"
    					}
    				}
    				If($Setting.ClientDrivesState -ne "NotConfigured")
    				{
    					line 3 "HDX Plug-n-Play\Client Resources\Drives\Connection: " $Setting.ClientDrivesState
    					If($Setting.ClientDrivesState -eq "Enabled")
    					{
    						If($Setting.ClientDrivesAreConnected)
    						{
    							line 3 "HDX Plug-n-Play\Client Resources\Drives\Connection\Connect Client Drives at Logon"
    						}
    						Else
    						{
    							line 3 "HDX Plug-n-Play\Client Resources\Drives\Connection\Do Not Connect Client Drives at Logon"
    						}
    					}
    				}
    				If($Setting.ClientDriveMappingState -ne "NotConfigured")
    				{
    					line 3 "HDX Plug-n-Play\Client Resources\Drives\Mappings: " $Setting.ClientDriveMappingState
    					If($Setting.ClientDriveMappingState -eq "Enabled")
    					{
    						If($Setting.TurnFloppyDriveMappingOff)
    						{
    							line 3 "HDX Plug-n-Play\Client Resources\Drives\Mappings\Turn off Floppy disk drives"
    						}
    						If($Setting.TurnHardDriveMappingOff)
    						{
    							line 3 "HDX Plug-n-Play\Client Resources\Drives\Mappings\Turn off Hard drives"
    						}
    						If($Setting.TurnCDRomDriveMappingOff)
    						{
    							line 3 "HDX Plug-n-Play\Client Resources\Drives\Mappings\Turn off CD-ROM drives"
    						}
    						If($Setting.TurnRemoteDriveMappingOff)
    						{
    							line 3 "HDX Plug-n-Play\Client Resources\Drives\Mappings\Turn off Remote drives"
    						}
    					}
    				}
    				If($Setting.ClientAsynchronousWritesState -ne "NotConfigured")
    				{
    					line 3 "HDX Plug-n-Play\Client Resources\Drives\Optimize\Asynchronous writes: " $Settings.ClientAsynchronousWritesState
    					If($Settings.ClientAsynchronousWritesState -eq "Enabled")
    					{
    						line 3 "HDX Plug-n-Play\Client Resources\Drives\Optimize\Asynchronous writes\Turn on asynchronous disk writes to client disks"
    					}
    
    					If($global:Server2008)
    					{
    						line 3 "HDX Plug-n-Play\Client Resources\Drives\Special folder redirection: " $Setting.TurnSpecialFolderRedirectionOffState
    						If($Setting.TurnSpecialFolderRedirectionOffState -eq "Enabled")
    						{
    							line 3 "HDX Plug-n-Play\Client Resources\Drives\Special folder redirection\Do not allow special folder redirection"
    						}
    					}
    				}
    
    				If($Setting.TurnComPortsOffState -ne "NotConfigured")
    				{
    					line 3 "HDX Plug-n-Play\Client Resources\Ports\Turn off COM ports: " $Setting.TurnComPortsOffState
    					If($Setting.TurnComPortsOffState -eq "Enabled")
    					{
    						line 3 "HDX Plug-n-Play\Client Resources\Ports\Turn off COM ports\Turn off client COM ports"
    					}
    				}
    				If($Setting.TurnLptPortsOffState -ne "NotConfigured")
    				{
    					line 3 "HDX Plug-n-Play\Client Resources\Ports\Turn off LPT ports: " $Setting.TurnLptPortsOffState
    					If($Setting.TurnLptPortsOffState -eq "Enabled")
    					{
    						line 3 "HDX Plug-n-Play\Client Resources\Ports\Turn off LPT ports\Turn off client LPT ports"
    					}
    				}
    				If($Setting.TurnVirtualComPortMappingOffState -ne "NotConfigured")
    				{
    					line 3 "HDX Plug-n-Play\Client Resources\PDA Devices\Turn on automatic virtual COM port mapping: " $Setting.TurnVirtualComPortMappingOffState
    					If($Setting.TurnVirtualComPortMappingOffState -eq "Enabled")
    					{
    						line 3 "HDX Plug-n-Play\Client Resources\PDA Devices\Turn on automatic virtual COM port mapping\Turn on virtual COM port mapping"
    					}
    				}
    				If($Setting.TwainRedirectionState -ne "NotConfigured")
    				{
    					line 3 "HDX Plug-n-Play\Client Resources\Other\Configure TWAIN redirection: " $Setting.TwainRedirectionState
    					If($Setting.TwainRedirectionState -eq "Enabled")
    					{
    						If($Setting.TwainRedirectionAllowed)
    						{
    							line 3 "HDX Plug-n-Play\Client Resources\Other\Configure TWAIN redirection\Allow TWAIN redirection"
    							If($Setting.TwainRedirectionImageCompression -eq "NoCompression")
    							{
    								line 3 "HDX Plug-n-Play\Client Resources\Other\Configure TWAIN redirection\Allow TWAIN redirection\Do not use lossy compression for high color images"
    							}
    							Else
    							{
    								line 3 "HDX Plug-n-Play\Client Resources\Other\Configure TWAIN redirection\Allow TWAIN redirection\Use lossy compression for high color images: " $Setting.TwainRedirectionImageCompression
    							}
    						}
    						Else
    						{
    							line 3 "HDX Plug-n-Play\Client Resources\Other\Configure TWAIN redirection\Allow TWAIN redirection\Do not allow TWAIN redirection"
    						}
    					}
    				}
    				If($Setting.TurnClipboardMappingOffState -ne "NotConfigured")
    				{
    					line 3 "HDX Plug-n-Play\Client Resources\Other\Turn off clipboard mapping: " $Setting.TurnClipboardMappingOffState
    					If($Setting.TurnClipboardMappingOffState -eq "Enabled")
    					{
    						line 3 "HDX Plug-n-Play\Client Resources\Other\Turn off clipboard mapping\Turn Off Client Clipboard Mapping"
    					}
    				}
    				If($Setting.TurnOemVirtualChannelsOffState -ne "NotConfigured")
    				{
    					line 3 "HDX Plug-n-Play\Client Resources\Other\Turn off OEM virtual channels: " $Setting.TurnOemVirtualChannelsOffState
    					If($Setting.TurnOemVirtualChannelsOffState -eq "Enabled")
    					{
    						line 3 "HDX Plug-n-Play\Client Resources\Other\Turn off OEM virtual channels\Turn Off OEM Virtual Channels"
    					}
    				}
    
    				If($Setting.TurnAutoClientUpdateOffState -ne "NotConfigured")
    				{
    					line 3 "HDX Plug-n-Play\Client Maintenance\Turn off auto client update: " $Setting.TurnAutoClientUpdateOffState
    					If($Setting.TurnAutoClientUpdateOffState -eq "Enabled")
    					{
    						line 3 "HDX Plug-n-Play\Client Maintenance\Turn off auto client update\Turn Off Auto Client Update"
    					}
    				}
    				If($Setting.ClientPrinterAutoCreationState -ne "NotConfigured")
    				{
    					line 3 "HDX Plug-n-Play\Printing\Client Printers\Auto-creation: " $Setting.ClientPrinterAutoCreationState
    					If($Setting.ClientPrinterAutoCreationState -eq "Enabled")
    					{
    						line 3 "HDX Plug-n-Play\Printing\Client Printers\Auto-creation\When connecting " $Setting.ClientPrinterAutoCreationOption
    					}
    				}
    
    				If($Setting.LegacyClientPrintersState -ne "NotConfigured")
    				{
    					line 3 "HDX Plug-n-Play\Printing\Client Printers\Legacy client printers: " $Setting.LegacyClientPrintersState
    					If($Setting.LegacyClientPrintersState -eq "Enabled")
    					{
    						If($Setting.LegacyClientPrintersDynamic)
    						{
    							line 3 "HDX Plug-n-Play\Printing\Client Printers\Legacy client printers\Create dynamic session-private client printers"
    						}
    						Else
    						{
    							line 3 "HDX Plug-n-Play\Printing\Client Printers\Legacy client printers\Create old-style client printers"
    						}
    					}
    				}
    				If($Setting.PrinterPropertiesRetentionState -ne "NotConfigured")
    				{
    					line 3 "HDX Plug-n-Play\Printing\Client Printers\Printer properties retention: " $Setting.PrinterPropertiesRetentionState
    					If($Setting.PrinterPropertiesRetentionState -eq "Enabled")
    					{
    						line 3 "HDX Plug-n-Play\Printing\Client Printers\Printer properties retention\Printer properties should be " $Setting.PrinterPropertiesRetentionOption
    					}
    				}
    				If($Setting.PrinterJobRoutingState -ne "NotConfigured")
    				{
    					line 3 "HDX Plug-n-Play\Printing\Client Printers\Print job routing: " $Setting.PrinterJobRoutingState
    					If($Setting.PrinterJobRoutingState -eq "Enabled")
    					{
    						line 3 "HDX Plug-n-Play\Printing\Client Printers\Print job routing\For client printers on a network printer server: " -NoNewLine
    						If($Setting.PrinterJobRoutingDirect)
    						{
    							line 0 "Connect directly to network print server if possible"
    						}
    						Else
    						{
    							line 0 "Always connect indirectly as a client printer"
    						}
    					}
    				}
    				If($Setting.TurnClientPrinterMappingOffState -ne "NotConfigured")
    				{
    					line 3 "HDX Plug-n-Play\Printing\Client Printers\Turn off client printer mapping: " $Setting.TurnClientPrinterMappingOffState
    					If($Setting.TurnClientPrinterMappingOffState -eq "Enabled")
    					{
    						line 3 "HDX Plug-n-Play\Printing\Client Printers\Turn off client printer mapping\Turn off client printer mapping"
    					}
    				}
    				If($Setting.DriverAutoInstallState -ne "NotConfigured")
    				{
    					line 3 "HDX Plug-n-Play\Printing\Drivers\Native printer driver auto-install: " $Setting.DriverAutoInstallState
    					If($Setting.DriverAutoInstallState -eq "Enabled")
    					{
    						If($Setting.DriverAutoInstallAsNeeded)
    						{
    							line 3 "HDX Plug-n-Play\Printing\Drivers\Native printer driver auto-install\Install Windows native drivers as needed"
    						}
    						Else
    						{
    							line 3 "HDX Plug-n-Play\Printing\Drivers\Native printer driver auto-install\Do not automatically install drivers"
    						}
    					}
    				}
    				If($Setting.UniversalDriverState -ne "NotConfigured")
    				{
    					line 3 "HDX Plug-n-Play\Printing\Drivers\Universal driver: " $Setting.UniversalDriverState
    					If($Setting.UniversalDriverState -eq "Enabled")
    					{
    						line 3 "HDX Plug-n-Play\Printing\Drivers\Universal driver\When auto-creating client printers: " $Setting.UniversalDriverOption
    					}
    				}
    				If($Setting.SessionPrintersState -ne "NotConfigured")
    				{
    					line 3 "HDX Plug-n-Play\Printing\Session printers\Session printers: " $Setting.SessionPrintersState
    					If($Setting.SessionPrintersState -eq "Enabled")
    					{
    						If($Setting.SessionPrinterList)
    						{
    							line 3 "HDX Plug-n-Play\Printing\Session printers\Session printers\Network printers to connect at logon:"
    							ForEach($Printer in $Setting.SessionPrinterList)
    							{
    								Line 7 $Printer
    							}
    						}
    						line 3 "HDX Plug-n-Play\Printing\Session printers\Client's default printer: " -NoNewLine
    						If($Setting.SessionPrinterDefaultOption -eq "SetToPrinterIndex")
    						{
    							line 0 $Setting.SessionPrinterList[$Setting.SessionPrinterDefaultIndex]
    						}
    						Else
    						{
    							line 0 $Setting.SessionPrinterDefaultOption
    						}
    					}
    				}
    				If($Setting.ContentRedirectionState -ne "NotConfigured")
    				{
    					line 3 "HDX Plug-n-Play\Content Redirection\Server to client: " $Setting.ContentRedirectionState
    					If($Setting.ContentRedirectionState -eq "Enabled")
    					{
    						If($Setting.ContentRedirectionIsUsed)
    						{
    							line 3 "HDX Plug-n-Play\Content Redirection\Server to client\Use Content Redirection from server to client"
    						}
    						Else
    						{
    							line 3 "HDX Plug-n-Play\Content Redirection\Server to client\Do not use Content Redirection from server to client"
    						}
    					}
    				}
    				If($Setting.TurnClientLocalTimeEstimationOffState -ne "NotConfigured")
    				{
    					line 3 "HDX Plug-n-Play\Time Zones\Do not estimate local time for legacy clients: " $Setting.TurnClientLocalTimeEstimationOffState
    					If($Setting.TurnClientLocalTimeEstimationOffState -eq "Enabled")
    					{
    						line 3 "HDX Plug-n-Play\Time Zones\Do not estimate local time for legacy clients\Do Not Estimate Client Local Time"
    					}
    				}
    				If($Setting.TurnClientLocalTimeEstimationOffState -ne "NotConfigured")
    				{
    					line 3 "HDX Plug-n-Play\Time Zones\Do not use Client's local time: " $Setting.TurnClientLocalTimeOffState
    					If($Setting.TurnClientLocalTimeOffState -eq "Enabled")
    					{
    						line 3 "HDX Plug-n-Play\Time Zones\Do not use Client's local time\Do Not Use Client's Local Time"
    					}
    				}
    
    				#User Workspace
    				If($Setting.ConcurrentSessionsState -ne "NotConfigured")
    				{
    					line 3 "User Workspace\Connections\Limit total concurrent sessions: " $Setting.ConcurrentSessionsState
    					If($Setting.ConcurrentSessionsState -eq "Enabled")
    					{
    						line 3 "User Workspace\Connections\Limit total concurrent sessions\Limit: " $Setting.ConcurrentSessionsLimit
    					}
    				}
    				If($Setting.ZonePreferenceAndFailoverState -ne "NotConfigured")
    				{
    					line 3 "User Workspace\Connections\Zone preference and failover: " $Setting.ZonePreferenceAndFailoverState
    					If($Setting.ZonePreferenceAndFailoverState -eq "Enabled")
    					{
    						line 3 "User Workspace\Connections\Zone preference and failover\Zone preference settings:"
    						ForEach($Pref in $Setting.ZonePreferences)
    						{
    							line 7 $Pref
    						}
    					}
    				}
    				If($Setting.ShadowingState -ne "NotConfigured")
    				{
    					line 3 "User Workspace\Shadowing\Configuration: " $Setting.ShadowingState
    					If($Setting.ShadowingState -eq "Enabled")
    					{
    						If($Setting.ShadowingAllowed)
    						{
    							line 3 "User Workspace\Shadowing\Configuration\Allow Shadowing"
    							line 3 "User Workspace\Shadowing\Configuration\Prohibit Being Shadowed Without Notification: " $Setting.ShadowingProhibitedWithoutNotification
    							line 3 "User Workspace\Shadowing\Configuration\Prohibit Remote Input When Being Shadowed: " $Setting.ShadowingRemoteInputProhibited
    						}
    						Else
    						{
    							line 3 "User Workspace\Shadowing\Configuration\Do Not Allow Shadowing"
    						}
    					}
    				}
    				If($Setting.ShadowingPermissionsState -ne "NotConfigured")
    				{
    					line 3 "User Workspace\Shadowing\Permissions: " $Setting.ShadowingPermissionsState
    					If($Setting.ShadowingPermissionsState -eq "Enabled")
    					{
    						If($Setting.ShadowingAccountsAllowed)
    						{
    							line 3 "User Workspace\Shadowing\Permissions\Accounts allowed to shadow:"
    							ForEach($Allowed in $Setting.ShadowingAccountsAllowed)
    							{
    								line 7 $Allowed
    							}
    						}
    						If($Setting.ShadowingAccountsDenied)
    						{
    							line 3 "User Workspace\Shadowing\Permissions\Accounts denied from shadowing:"
    							ForEach($Denied in $Setting.ShadowingAccountsDenied)
    							{
    								line 7 $Denied
    							}
    						}
    					}
    				}
    				If($Setting.CentralCredentialStoreState -ne "NotConfigured")
    				{
    					line 3 "User Workspace\Single Sign-On\Central Credential Store: " $Setting.CentralCredentialStoreState
    					If($Setting.CentralCredentialStoreState -eq "Enabled")
    					{
    						If($Setting.CentralCredentialStorePath)
    						{
    							line 3 "User Workspace\Single Sign-On\Central Credential Store\UNC path of Central Credential Store: " $Setting.CentralCredentialStorePath
    						}
    						Else
    						{
    							line 3 "User Workspace\Single Sign-On\Central Credential Store\No UNC path to Central Credential Store entered"
    						}
    					}
    				}
    				If($Setting.TurnPasswordManagerOffState -ne "NotConfigured")
    				{
    					line 3 "User Workspace\Single Sign-On\Do not use Citrix Password Manager: " $Setting.TurnPasswordManagerOffState
    					If($Setting.TurnPasswordManagerOffState -eq "Enabled")
    					{
    						line 3 "User Workspace\Single Sign-On\Do not use Citrix Password Manager\Do not use Citrix Password Manager"
    					}
    				}
    				If($Setting.StreamingDeliveryProtocolState -ne "NotConfigured")
    				{
    					line 3 "User Workspace\Streamed Applications\Configure delivery protocol: " $Setting.StreamingDeliveryProtocolState
    					If($Setting.StreamingDeliveryProtocolState -eq "Enabled")
    					{
    						line 3 "User Workspace\Streamed Applications\Configure delivery protocol\Streaming Delivery Protocol option: " $Setting.StreamingDeliveryOption
    					}
    				}
    
    				#Security
    				If($Setting.SecureIcaEncriptionState -ne "NotConfigured")
    				{
    					line 3 "Security\Encryption\SecureICA encryption: " $Setting.SecureIcaEncriptionState
    					If($Setting.SecureIcaEncriptionState -eq "Enabled")
    					{
    						line 3 "Security\Encryption\SecureICA encryption\Encryption level: " $Setting.SecureIcaEncriptionLevel
    					}
    				}
    
    				#Service Level (2008 only)
    				If($global:Server2008)
    				{
    					If($Setting.SecureIcaEncriptionState -ne "NotConfigured")
    					{
    						line 3 "Service Level\Session Importance: " $Setting.SessionImportanceState
    						If($Setting.SessionImportanceState -eq "Enabled")
    						{
    							line 3 "Service Level\Session Importance\Importance level: " $Setting.SessionImportanceLevel
    						}
    					}
    				}
    			}
    		}
    		Else
    		{
    			Line 2 "Unable to retrieve settings"
    		}
    
    		write-output $global:output
    		$global:output = $null
    		$Settings = $null
    		$Filter = $null
    	}
    }
    Else
    {
    	line 0 "Citrix Policy information could not be retrieved."
    }
    $Policies = $null
    $global:output = $null
    

     

    Sample script output from XA503:
    
    Policies:
    
    		Policy Name: Sample Policy
    				Description:
    				Enabled: True
    				Priority: 1
    				Policy Filters:
    						Allowed Server Folders:
    								Servers
    				Policy Settings:
    						HDX 3D\Progressive Display\Progressive Display: Enabled
    						HDX 3D\Progressive Display\Progressive Display\Compression level: HighCompression
    						HDX 3D\Progressive Display\Progressive Display\Compression level\Restrict compression to connections under this bandwidth: True
    						HDX 3D\Progressive Display\Progressive Display\Compression level\Restrict compression to connections under this bandwidth\Threshhold (Kb/sec): 64
    						HDX 3D\Progressive Display\Progressive Display\SpeedScreen Progressive Display compression level: UltrahighCompression
    						HDX 3D\Progressive Display\Progressive Display\Restrict compression to connections under this bandwidth: True
    						HDX 3D\Progressive Display\Progressive Display\Restrict compression to connections under this bandwidth\Threshhold (Kb/sec): 512
    						HDX 3D\Progressive Display\Progressive Display\Use Heavyweight compression (extra CPU, retains quality): True
    						HDX Broadcast\Visual Effects\Turn off desktop wallpaper: Enabled
    						HDX Broadcast\Visual Effects\Turn off desktop wallpaper\Turn Off Desktop Wallpaper
    						HDX Broadcast\Visual Effects\Turn off window contents while dragging: Enabled
    						HDX Broadcast\Visual Effects\Turn off window contents while dragging\Turn Off Windows Contents While Dragging
    						HDX Plug-n-Play\Printing\Client Printers\Auto-creation: Enabled
    						HDX Plug-n-Play\Printing\Client Printers\Auto-creation\When connecting DoNotAutoCreate
    						HDX Plug-n-Play\Printing\Client Printers\Legacy client printers: Disabled
    						HDX Plug-n-Play\Printing\Drivers\Native printer driver auto-install: Enabled
    						HDX Plug-n-Play\Printing\Drivers\Native printer driver auto-install\Do not automatically install drivers
    						HDX Plug-n-Play\Printing\Drivers\Universal driver: Enabled
    						HDX Plug-n-Play\Printing\Drivers\Universal driver\When auto-creating client printers: ExclusiveOnly
    						HDX Plug-n-Play\Printing\Session printers\Session printers: Enabled
    						HDX Plug-n-Play\Printing\Session printers\Client's default printer: SetToClientMainPrinter
    						User Workspace\Connections\Limit total concurrent sessions: Enabled
    						User Workspace\Connections\Limit total concurrent sessions\Limit: 2
    						User Workspace\Shadowing\Configuration: Enabled
    						User Workspace\Shadowing\Configuration\Allow Shadowing
    						User Workspace\Shadowing\Configuration\Prohibit Being Shadowed Without Notification: False
    						User Workspace\Shadowing\Configuration\Prohibit Remote Input When Being Shadowed: False
    						User Workspace\Single Sign-On\Do not use Citrix Password Manager: Enabled
    						User Workspace\Single Sign-On\Do not use Citrix Password Manager\Do not use Citrix Password Manager
    						Security\Encryption\SecureICA encryption: Enabled
    						Security\Encryption\SecureICA encryption\Encryption level: Bits128
    
    Sample script output from XA508:
    
    Policies:
    
        Policy Name: Settings that apply to 2008 only
            Description:
            Enabled: True
            Priority: 1
            Policy Filters:
                Allowed Server Folders:
                    Servers
            Policy Settings:
                HDX Broadcast\Visual Effects\Turn off menu animations: Enabled
                HDX Broadcast\Visual Effects\Turn off menu animations\Turn Off Menu and Window Animations
                Session Limits (%)\Audio: Enabled
                Session Limits (%)\Audio\Limit (%): 1
                Session Limits (%)\Clipboard: Enabled
                Session Limits (%)\Clipboard\Limit (%): 2
                Session Limits (%)\COM Ports: Enabled
                Session Limits (%)\COM Ports\Limit (%): 3
                Session Limits (%)\Drives: Enabled
                Session Limits (%)\Drives\Limit (%): 4
                Session Limits (%)\LPT Ports: Enabled
                Session Limits (%)\LPT Ports\Limit (%): 5
                Session Limits (%)\OEM Virtual Channels: Enabled
                Session Limits (%)\OEM Virtual Channels\Limit (%): 6
                Session Limits (%)\Printer: Enabled
                Session Limits (%)\Printer\Limit (%): 7
                Session Limits (%)\TWAIN Redirection: Enabled
                Session Limits (%)\TWAIN Redirection\Limit (%): 8
                HDX Plug-n-Play\Client Resources\Drives\Connection: Enabled
                HDX Plug-n-Play\Client Resources\Drives\Connection\Connect Client Drives at Logon
                HDX Plug-n-Play\Client Resources\Drives\Mappings: Enabled
    

    Next, list the printer drivers available in the farm.

    $PrinterDrivers = Get-XAPrinterDriver -EA 0 | sort-object DriverName
    
    If( $? -and $PrinterDrivers)
    {
    	line 0 ""
    	line 0 "Print Drivers:"
    	ForEach($PrinterDriver in $PrinterDrivers)
    	{
    		line 1 "Driver : " $PrinterDriver.DriverName
    		line 1 "Platform: " $PrinterDriver.OSVersion
    		line 1 "64 bit? : " $PrinterDriver.Is64Bit
    		line 0 ""
    	}
    	write-output $global:output
    	$global:output = $null
    }
    Else
    {
    	line 0 "Printer driver information could not be retrieved"
    }
    
    $PrintDrivers = $null
    $global:output = $null
    

     

    Sample script output from XA503:
    
    Print Drivers:
    
    		Driver : Citrix Universal Printer
    		Platform: 5.2
    		64 bit? : False
    
    		Driver : Citrix Universal Printer
    		Platform: 5.2
    		64 bit? : True
    
    		Driver : Generic / Text Only
    		Platform: 5.2
    		64 bit? : False
    
    		Driver : HP Color LaserJet 4500
    		Platform: 5.2
    		64 bit? : True
    
    		Driver : HP Color LaserJet 4500
    		Platform: 5.2
    		64 bit? : False
    
    		Driver : HP Color LaserJet PS
    		Platform: 5.2
    		64 bit? : False
    
    		Driver : HP Color LaserJet PS
    		Platform: 5.2
    		64 bit? : True
    
    		Driver : HP LaserJet Series II
    		Platform: 5.2
    		64 bit? : False
    
    		Driver : HP LaserJet Series II
    		Platform: 5.2
    		64 bit? : True
    
    		Driver : Microsoft XPS Document Writer
    		Platform: 5.2
    		64 bit? : True
    
    		Driver : Microsoft XPS Document Writer
    		Platform: 5.2
    		64 bit? : False
    

    Next, list the print driver mappings.

    $PrinterDriverMappings = Get-XAPrinterDriverMapping -EA 0 | sort-object ClientDriverName
    
    If( $? -and $PrinterDriverMappings)
    {
    	line 0 ""
    	line 0 "Print Driver Mappings:"
    	ForEach($PrinterDriverMapping in $PrinterDriverMappings)
    	{
    		line 1 "Client Driver: " $PrinterDriverMapping.ClientDriverName
    		line 1 "Server Driver: " $PrinterDriverMapping.ServerDriverName
    		line 1 "Platform: " $PrintDriverMapping.OSVersion
    		line 1 "64 bit? : " $PrinterDriverMapping.Is64Bit
    		line 0 ""
    	}
    	write-output $global:output
    	$global:output = $null
    }
    Else
    {
    	line 0 "Printer driver mapping information could not be retrieved"
    }
    
    $PrintDriverMappings = $null
    $global:output = $null
    

     

    Sample script output from XA503:
    
    Print Driver Mappings:
    
    		Client Driver: Brother Something or Other
    		Server Driver: HP Color LaserJet 4500
    		Platform:
    		64 bit? : False
    

    Even though it is not a separate node in either the DSC or AMC, Citrix does provide a way to get the Configuration Log report.

    Originally I had this set so that the $ConnectionString parameters would need to be manually set. It wasn’t until I was writing this article that I realized the flaw in my thinking. Since I also provide a signed copy of the script, manually changing the script is impossible. If the signed copy of the script is altered, the script is no longer valid and will not run. The way around this dilemma is to use a UDL file. For an explanation, see http://tinyurl.com/CreateUDLFile.

    The UDL file will need to be placed in the same folder as this script. The UDL file will need to be named XA5ConfigLog.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=XA6ConfigLog;Data Source=SQL;Password=abcd1234

    If( $Global:ConfigLog)
    {
    	#Configuration Logging report
    	#only process if $Global:ConfigLog = $True and .\XA5ConfigLog.udl file exists
    	#build connection string for Microsoft SQL Server
    	#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 .\XA5ConfigLog.udl )
    	{
    		$ConnectionString = Get-Content .\xa5configlog.udl | select-object -last 1
    		$ConfigLogReport = get-XAConfigurationLog -connectionstring $ConnectionString -EA 0
    
    		If( $? -and $ConfigLogReport)
    		{
    			line 0 ""
    			line 0 "Configuration Log Report:"
    			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 "Configuration log report could not be retrieved"
    		}
    		Write-Output $global:output
    		$ConfigLogReport = $null
    		$global:output = $null
    	}
    	Else
    	{
    		line 0 "XA5ConfigLog.udl file was not found"
    	}
    }
    

     

    Sample script output from XA503:
    
    Configuration Log Report:
    
    		Date: 09/30/2011 21:44:20
    		Account: WEBSTERSLAB\Administrator
    		Change description: Settings for Configuration Logging were initialized.
    		Type of change: Modified
    		Type of item: Farm
    		Name of item: XA52003
    
    		Date: 09/30/2011 22:14:50
    		Account: WEBSTERSLAB\Administrator
    		Change description: Server XA520032 was installed.
    		Type of change: Created
    		Type of item: Server
    		Name of item: XA520032
    
    		Date: 09/30/2011 22:14:50
    		Account: WEBSTERSLAB\Administrator
    		Change description: Server XA520031 was installed.
    		Type of change: Created
    		Type of item: Server
    		Name of item: XA520031
    
    		Date: 10/01/2011 14:56:14
    		Account: WEBSTERSLAB\administrator
    		Change description: Administrator WEBSTERSLAB\bshell was added.
    		Type of change: Created
    		Type of item: User
    		Name of item: WEBSTERSLAB\bshell
    
    		Date: 10/01/2011 14:57:21
    		Account: WEBSTERSLAB\administrator
    		Change description: Administrator WEBSTERSLAB\cwebster was added.
    		Type of change: Created
    		Type of item: User
    		Name of item: WEBSTERSLAB\cwebster
    
    		Date: 10/01/2011 14:59:18
    		Account: WEBSTERSLAB\administrator
    		Change description: Application Notepad was published.
    		Type of change: Created
    		Type of item: Application
    		Name of item: Notepad
    
    Sample script output from XA508:
    
    Configuration Log Report:
    
    		Date: 10/01/2011 15:06:25
    		Account: WEBSTERSLAB\administrator
    		Change description: Settings for Configuration Logging were updated.
    		Type of change: Modified
    		Type of item: Farm
    		Name of item: XA52008
    
    		Date: 10/01/2011 15:07:26
    		Account: WEBSTERSLAB\administrator
    		Change description: Citrix XML Service DNS address resolution was modified for farm XA52008.
    		Type of change: Modified
    		Type of item: Farm
    		Name of item: XA52008
    
    		Date: 10/01/2011 15:07:26
    		Account: WEBSTERSLAB\administrator
    		Change description: 280202
    		Type of change: Modified
    		Type of item: 20
    		Name of item: XA52008
    
    		Date: 10/01/2011 15:07:26
    		Account: WEBSTERSLAB\administrator
    		Change description: Log Rade Events was modified for farm XA52008.
    		Type of change: Modified
    		Type of item: Farm
    		Name of item: XA52008
    
    		Date: 10/01/2011 15:07:26
    		Account: WEBSTERSLAB\administrator
    		Change description: Farm settings were modified for XA52008.
    		Type of change: Modified
    		Type of item: Farm
    		Name of item: XA52008
    
    		Date: 10/01/2011 15:07:26
    		Account: WEBSTERSLAB\administrator
    		Change description: Connection Limits per user were modified for farm XA52008.
    		Type of change: Modified
    		Type of item: Farm
    		Name of item: XA52008
    

    How to use this script?

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

    .\XA5_Inventory.ps1 |out-file .\XA5Farm.txt

    Open XA5Farm.txt in either WordPad or Microsoft Word (Figure 28).

    Figure 28
    Figure 28

    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

    16 Responses to “Documenting a Citrix XenApp 5 Farm with Microsoft PowerShell”

    1. Michael Says:

      Can I run this script as -HTML or -Text? I don’t have the ability to install on this server.

      Reply

    2. Rakesh Says:

      recently I downloaded XenApp 5 Powershell from http://blogs.citrix.com/2010/09/14/xenapp-5-powershell-sdk-tech-preview-3-released/
      After installing it, i observed that the program load approximately 15 to 30 mints
      Is there anything that can save my time??

      Reply

    3. Hilary Clegg Says:

      There is a new link to download the required XenApp commands CTP 3. I got this link from http://blogs.citrix.com/2010/09/14/xenapp-5-powershell-sdk-tech-preview-3-released/. The new link is https://citrix.sharefile.com/d/s2f4bd37f04c4836b.

      Reply

    4. Cata Says:

      Hey Carl, I know this article is referencing older technology (which is actually still being used at my new/current job :)) …. but any idea if I can find anywhere the Powershell SDK for XenApp 5 ???? 🙁 Maybe you have a copy saved somewhere ? Citrix doesn’t offer it anymore.. While I work on the migration to a newer Citrix version, I would still like to be able to monitor/healthcheck the XenApp 5 farms. Thank you much!

      Reply

    5. robert Nguyen Says:

      for some reason I get this error it looks like word is not saving the document

      could you shead some light on this

      WARNING: Printer driver mapping information could not be retrieved
      Unable to find type [Microsoft.Office.Interop.Word.WdSaveFormat]: make sure that the assembly containing this type is l
      oaded.
      At C:\Users\virtuosoadmin\XA5_Inventory.ps1:4681 char:73
      + $saveFormat = [Enum]::Parse([Microsoft.Office.Interop.Word.WdSaveFormat] <<<< , "wdFormatDocumentDefault")
      + CategoryInfo : InvalidOperation: (Microsoft.Offic…rd.WdSaveFormat:String) [], RuntimeException
      + FullyQualifiedErrorId : TypeNotFound

      The variable '$SaveFormat' cannot be retrieved because it has not been set.
      At C:\Users\virtuosoadmin\XA5_Inventory.ps1:4682 char:45
      + $doc.SaveAs([REF]$filename, [ref]$SaveFormat <<<< )
      + CategoryInfo : InvalidOperation: (SaveFormat:Token) [], RuntimeException
      + FullyQualifiedErrorId : VariableIsUndefined

      Reply

    6. Marius Says:

      Does this work also on PS 4.5?

      Reply

    7. Bernardo Says:

      Hi Carl,

      Fanatastic script for reporting on XenApp 5 Farms.

      I have a requierement for reporting on a few servers, which are fairly easy to get at because they are in alphabetical order, but the applications are not.
      To make a long story a very short one.
      I have to get a report about applications and the configurations, but only from a few servers.

      I have managed to modify the script to have a report with only the application reporting. What I haven’t been succesful in is instead of having the application being ordered, having the servers being ordered.

      Any ideas???

      Thanks!!!

      Reply

    8. Jared Says:

      Great script! I didn’t include the conf logging part and I still got a 841 page document about my XA 4.5 HRP 07 farm. I have one rather minor question since I am new to PowerShell, can the policies be returned in priority order instead of alphabetically?

      Reply

      • Carl Webster Says:

        I believe that is doable. Change this line:

        $Policies = Get-XAPolicy -EA 0 | sort-object PolicyName

        to

        $Policies = Get-XAPolicy -EA 0 | sort-object Priority

        Thanks

        Webster

        Reply

    Leave a Reply