-
Documenting a Citrix XenApp 6.5 Farm with Microsoft PowerShell – Version 2
The original article on Documenting a Citrix XenApp 6.5 Farm with Microsoft PowerShell was released on October 7, 2011. The original script has been downloaded over 16,000 times. I decided it was time to update the script to have the output match what was shown in AppCenter. With a lot of help (and patience) from Exchange MVP and PowerShell guru Michael B. Smith, I updated the original script from over 1800 lines to over 2900 lines of PowerShell to thoroughly document a XenApp 6.5 farm. This article will focus on the changes to the script.
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/
I would like to thank the following people for helping to test the script.- @BYODre
- Andrew Morgan
- Bart Jacobs
- Brian Hecker
- Derick
- Jarian Gibson
- J. L. Straat
- Jennifer Auiler
- Kees Baggerman
- Knut Gunnar Neggen
- Magnus Hjorleifsson
- Mark Fermin
- Ryan Revord
- Thomas Poppelgaard
- And 24 others
Before we get started, I want you to know that I am NOT a programmer. I am NOT a software developer and I am NOT a real PowerShell coder. I am simply a hack who brute forces his way through all this PowerShell stuff until I either figure it out myself or have to use a lifeline. i.e. Michael B. Smith, Jeff Wouter or worse, I have to read a book!
The prerequisites to follow along with this article are:
- A server, physical or virtual, running Microsoft Windows Server 2008 R2 with or without SP1
- Citrix XenApp 6.5 installed with or without HRP01
Note: A few testers reported that neither this script nor AppCenter displayed the hotfixes installed on the data collectors. Citrix has a public hotfix that should resolve that specific issue. http://support.citrix.com/article/CTX132713
The nice thing about XenApp 6.5 compared to both XenApp 5 and XenApp 6 is that all the basic Citrix PowerShell stuff is installed when you install XenApp 6.5. But we still need the XenApp 6.5 PowerShell Help and the Citrix Group Policy PowerShell Commands. You can read the original article for instructions on how to download and install those components.
My goal is to use the same wording as what is seen in the AppCenter for headings, captions and text. This required a lot of extra coding and learning some new things in PowerShell. In the original script, there were some Citrix policy settings where I thought Citrix stored no data. Turns out that I didn’t know how to retrieve the data. My friend MBS had to teach me what I didn’t understand originally. There were still some objects where the properties contained no data. For example, for the XAServer object, the property ServerFqdn has never returned any data for any of the servers I tested it on. For properties like ServerFqdn, I have chosen to remove them from the script so they don’t clutter up the output.
Andrew Morgan added a Function to the script to make sure the three required PowerShell snap-ins are loaded.
Function Check-NeededPSSnapins { Param( [parameter(Mandatory = $true)][alias("Snapin")][string[]]$Snapins) #function specifics $MissingSnapins=@() $FoundMissingSnapin=$false #Creates arrays of strings, rather than objects, we're passing strings so this will be more robust. $loadedSnapins += get-pssnapin | % {$_.name} $registeredSnapins += get-pssnapin -Registered | % {$_.name} foreach ($Snapin in $Snapins){ #check if the snapin is loaded if (!($LoadedSnapins -like $snapin)){ #Check if the snapin is missing if (!($RegisteredSnapins -like $Snapin)){ #set the flag if it's not already if (!($FoundMissingSnapin)){ $FoundMissingSnapin = $True } #add the entry to the list $MissingSnapins += $Snapin }#End Registered If Else{ #Snapin is registered, but not loaded, loading it now: Write-Host "Loading Windows PowerShell snap-in: $snapin" Add-PSSnapin -Name $snapin } }#End Loaded If #Snapin is registered and loaded else{write-debug "Windows PowerShell snap-in: $snapin - Already Loaded"} }#End For if ($FoundMissingSnapin){ write-warning "Missing Windows PowerShell snap-ins Detected:" $missingSnapins | % {write-warning "($_)"} return $False }#End If Else{ Return $true }#End Else }#End Function
At the beginning of the script, we check for the required snap-ins.
if (!(Check-NeededPSSnapins "Citrix.Common.Commands","Citrix.Common.GroupPolicy","Citrix.XenApp.Commands")){ #We're missing Citrix Snapins that we need write-error "Missing Citrix PowerShell Snap-ins Detected, check the console above for more information. Are you sure you are running this script on a XenApp 6.5 Server? Script will now close." break }
If the snap-ins do not exist because the script is not being run on a XenApp 6.5 server, we get the following.
WARNING: Missing Windows PowerShell snap-ins Detected: WARNING: (Citrix.Common.Commands) WARNING: (Citrix.Common.GroupPolicy) WARNING: (Citrix.XenApp.Commands) E:\test.ps1 : Missing Citrix PowerShell Snap-ins Detected, check the console above for more information. Are you sure y ou are running this script on a XenApp 6.5 Server? Script will now close. At line:1 char:11 + .\test.ps1 <<<< + CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,test.ps1
If the snap-ins are not loaded in the current PowerShell session, they are loaded.
Loading Windows PowerShell snap-in: Citrix.Common.Commands Loading Windows PowerShell snap-in: Citrix.Common.GroupPolicy Loading Windows PowerShell snap-in: Citrix.XenApp.Commands
The original script would just stop working if the Citrix.GroupPolicy.Commands module was not loaded into the current PowerShell session before the script was run. Jeff Wouters supplied a function to make sure the Citrix.GroupPolicy.Commands module was loaded. Michael B. Smith modified the function so it worked if the module is not installed on the server. And Andrew Morgan suggested an improvement to MBS’ update to make it even better.
Function Check-LoadedModule #function created by Jeff Wouters #@JeffWouters on Twitter #modified by Michael B. Smith to handle when the module doesn't exist on server #modified by @andyjmorgan #bug fixed by @schose #This function handles all three scenarios: # # 1. Module is already imported into current session # 2. Module is not already imported into current session, it does exists on the server and is imported # 3. Module does not exist on the server { Param( [parameter(Mandatory = $true)][alias("Module")][string]$ModuleName) #$LoadedModules = Get-Module | Select Name #following line changed at the recommendation of @andyjmorgan $LoadedModules = Get-Module |% { $_.Name.ToString() } #bug reported on 21-JAN-2013 by @schose #the following line did not work if the citrix.grouppolicy.commands.psm1 module #was manually loaded from a non default folder #$ModuleFound = (!$LoadedModules -like "*$ModuleName*") $ModuleFound = ($LoadedModules -like "*$ModuleName*") if (!$ModuleFound) { $module = Import-Module -Name $ModuleName –PassThru –EA 0 If( $module –and $? ) { # module imported properly Return $True } Else { # module import failed Return $False } } Else { #module already imported into current session Return $true } }
If the Citrix.GroupPolicy.Commands module is already loaded into the current session, the script continues. If the Citrix.GroupPolicy.Commands module is not loaded into the current session and the module exists on the server, the module is loaded and the script continues. If the Citrix.GroupPolicy.Commands module does not exist on the server, the script will issue a warning and ends gracefully. Citrix farm policy processing is the last thing the script does.
WARNING: The Citrix Group Policy module Citrix.GroupPolicy.Commands.psm1 does not exist (http://support.citrix.com/article/CTX128625), Citrix Policy documentation will not take place.
There were no changes made to the Farm or Configuration Logging sections.
The next section is Administrators. Changes were made to the Administrator Type, Farm Privileges and Folder Permissions.
The new Administrators section:
$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: " -nonewline switch ($Administrator.AdministratorType) { "Unknown" {line 0 "Unknown"} "Full" {line 0 "Full Administration"} "ViewOnly" {line 0 "View Only"} "Custom" {line 0 "Custom"} Default {line 0 "Administrator type could not be determined: $($Administrator.AdministratorType)"} } line 1 "Administrator account is " -NoNewLine If($Administrator.Enabled) { line 0 "Enabled" } Else { line 0 "Disabled" } If ($Administrator.AdministratorType -eq "Custom") { line 1 "Farm Privileges:" ForEach($farmprivilege in $Administrator.FarmPrivileges) { switch ($farmprivilege) { "Unknown" {line 2 "Unknown"} "ViewFarm" {line 2 "View farm management"} "EditZone" {line 2 "Edit zones"} "EditConfigurationLog" {line 2 "Configure logging for the farm"} "EditFarmOther" {line 2 "Edit all other farm settings"} "ViewAdmins" {line 2 "View Citrix administrators"} "LogOnConsole" {line 2 "Log on to console"} "LogOnWIConsole" {line 2 "Logon on to Web Interface console"} "ViewLoadEvaluators" {line 2 "View load evaluators"} "AssignLoadEvaluators" {line 2 "Assign load evaluators"} "EditLoadEvaluators" {line 2 "Edit load evaluators"} "ViewLoadBalancingPolicies" {line 2 "View load balancing policies"} "EditLoadBalancingPolicies" {line 2 "Edit load balancing policies"} "ViewPrinterDrivers" {line 2 "View printer drivers"} "ReplicatePrinterDrivers" {line 2 "Replicate printer drivers"} Default {line 2 "Farm privileges could not be determined: $($farmprivilege)"} } } line 1 "Folder Privileges:" ForEach($folderprivilege in $Administrator.FolderPrivileges) { #The Citrix PoSH cmdlet only returns data for three folders: #Servers #WorkerGroups #Applications line 2 $FolderPrivilege.FolderPath ForEach($FolderPermission in $FolderPrivilege.FolderPrivileges) { switch ($folderpermission) { "Unknown" {line 3 "Unknown"} "ViewApplications" {line 3 "View applications"} "EditApplications" {line 3 "Edit applications"} "TerminateProcessApplication" {line 3 "Terminate process that is created as a result of launching a published application"} "AssignApplicationsToServers" {line 3 "Assign applications to servers"} "ViewServers" {line 3 "View servers"} "EditOtherServerSettings" {line 3 "Edit other server settings"} "RemoveServer" {line 3 "Remove a bad server from farm"} "TerminateProcess" {line 3 "Terminate processes on a server"} "ViewSessions" {line 3 "View ICA/RDP sessions"} "ConnectSessions" {line 3 "Connect sessions"} "DisconnectSessions" {line 3 "Disconnect sessions"} "LogOffSessions" {line 3 "Log off sessions"} "ResetSessions" {line 3 "Reset sessions"} "SendMessages" {line 3 "Send messages to sessions"} "ViewWorkerGroups" {line 3 "View worker groups"} "AssignApplicationsToWorkerGroups" {line 3 "Assign applications to worker groups"} Default {line 3 "Folder permission could not be determined: $($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
Original script output:
Administrators: Administrator name: XA65\Administrator Administrator type: Full Administrator Administrator account is Enabled Administrator name: XA65\Anon000 Administrator type: ViewOnly Administrator Administrator account is Enabled Administrator name: XA65\Anon001 Administrator type: Custom Administrator Administrator account is Enabled Farm Privileges: EditFarmOther EditConfigurationLog EditZone ViewFarm LogOnWIConsole LogOnConsole ViewAdmins AssignLoadEvaluators EditLoadEvaluators ViewLoadEvaluators EditLoadBalancingPolicies ViewLoadBalancingPolicies ReplicatePrinterDrivers ViewPrinterDrivers Folder Privileges: Servers: AssignApplicationsToServers ViewSessions ConnectSessions SendMessages LogOffSessions DisconnectSessions ResetSessions ViewServers EditOtherServerSettings RemoveServer TerminateProcess WorkerGroups: ViewWorkerGroups AssignApplicationsToWorkerGroups Applications: ViewApplications EditApplications ViewSessions ConnectSessions SendMessages LogOffSessions DisconnectSessions ResetSessions TerminateProcessApplication
Updated script output:
Administrators: Administrator name: XA65\Administrator Administrator type: Full Administration Administrator account is Enabled Administrator name: XA65\Anon000 Administrator type: View Only Administrator account is Enabled Administrator name: XA65\Anon001 Administrator type: Custom Administrator account is Enabled Farm Privileges: Edit all other farm settings Configure logging for the farm Edit zones View farm management Logon on to Web Interface console Log on to console View Citrix administrators Assign load evaluators Edit load evaluators View load evaluators Edit load balancing policies View load balancing policies Replicate printer drivers View printer drivers Folder Privileges: Servers Assign applications to servers View ICA/RDP sessions Connect sessions Send messages to sessions Log off sessions Disconnect sessions Reset sessions View servers Edit other server settings Remove a bad server from farm Terminate processes on a server WorkerGroups View worker groups Assign applications to worker groups Applications View applications Edit applications View ICA/RDP sessions Connect sessions Send messages to sessions Log off sessions Disconnect sessions Reset sessions Terminate process that is created as a result of launching a published application
Next section is applications.
Two of the improvements I made were to line up the text and if a properties’ value was blank, to suppress that line from being shown. I did this so the output doesn’t look so cluttered.
New application section:
$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 : " $Application.BrowserName line 2 "Disable application : " -NoNewLine #weird, if application is enabled, it is disabled! If ($Application.Enabled) { line 0 "No" } Else { line 0 "Yes" line 2 "Hide disabled application: " -nonewline If($Application.HideWhenDisabled) { line 0 "Yes" } Else { line 0 "No" } } If(![String]::IsNullOrEmpty( $Application.Description)) { line 2 "Application description : " $Application.Description } #type properties line 2 "Application Type : " -nonewline switch ($Application.ApplicationType) { "Unknown" {line 0 "Unknown"} "ServerInstalled" {line 0 "Installed application"} "ServerDesktop" {line 0 "Server desktop"} "Content" {line 0 "Content"} "StreamedToServer" {line 0 "Streamed to server"} "StreamedToClient" {line 0 "Streamed to client"} "StreamedToClientOrInstalled" {line 0 "Streamed if possible, otherwise accessed from server as Installed application"} "StreamedToClientOrStreamedToServer" {line 0 "Streamed if possible, otherwise Streamed to server"} Default {line 0 "Application Type could not be determined: $($Application.ApplicationType)"} } If(![String]::IsNullOrEmpty( $Application.FolderPath)) { line 2 "Folder path : " $Application.FolderPath } If(![String]::IsNullOrEmpty( $Application.ContentAddress)) { line 2 "Content Address : " $Application.ContentAddress } #if a streamed app If($streamedapp) { line 2 "Citrix streaming app profile address : " line 3 $Application.ProfileLocation line 2 "App to launch from Citrix stream app profile : " line 3 $Application.ProfileProgramName If(![String]::IsNullOrEmpty( $Application.ProfileProgramArguments)) { line 2 "Extra command line parameters : " line 3 $Application.ProfileProgramArguments } #if streamed, Offline access properties If($Application.OfflineAccessAllowed) { line 2 "Enable offline access : " -nonewline If($Application.OfflineAccessAllowed) { line 0 "Yes" } Else { line 0 "No" } } If($Application.CachingOption) { line 2 "Cache preference : " -nonewline switch ($Application.CachingOption) { "Unknown" {line 0 "Unknown"} "PreLaunch" {line 0 "Cache application prior to launching"} "AtLaunch" {line 0 "Cache application during launch"} Default {line 0 "Application Cache preference could not be determined: $($Application.CachingOption)"} } } } #location properties If(!$streamedapp) { If(![String]::IsNullOrEmpty( $Application.CommandLineExecutable)) { If($Application.CommandLineExecutable.Length -lt 40) { line 2 "Command line : " $Application.CommandLineExecutable } Else { line 2 "Command line : " line 3 $Application.CommandLineExecutable } } If(![String]::IsNullOrEmpty( $Application.WorkingDirectory)) { If($Application.WorkingDirectory.Length -lt 40) { line 2 "Working directory : " $Application.WorkingDirectory } Else { line 2 "Working directory : " line 3 $Application.WorkingDirectory } } #servers properties If($AppServerInfoResults) { If(![String]::IsNullOrEmpty( $AppServerInfo.ServerNames)) { line 2 "Servers:" ForEach($servername in $AppServerInfo.ServerNames) { line 3 $servername } } If(![String]::IsNullOrEmpty($AppServerInfo.WorkerGroupNames)) { line 2 "Workergroups:" ForEach($workergroup in $AppServerInfo.WorkerGroupNames) { line 3 $workergroup } } } Else { line 3 "Unable to retrieve a list of Servers or Worker Groups for this application" } } #users properties If($Application.AnonymousConnectionsAllowed) { line 2 "Allow anonymous users : " $Application.AnonymousConnectionsAllowed } Else { If($AppServerInfoResults) { line 2 "Users:" ForEach($user in $AppServerInfo.Accounts) { line 3 $user } } Else { line 3 "Unable to retrieve a list of Users for this application" } } #shortcut presentation properties #application icon is ignored If(![String]::IsNullOrEmpty($Application.ClientFolder)) { If($Application.ClientFolder.Length -lt 30) { line 2 "Client application folder : " $Application.ClientFolder } Else { line 2 "Client application folder : " line 3 $Application.ClientFolder } } If($Application.AddToClientStartMenu) { line 2 "Add to client's start menu" If($Application.StartMenuFolder) { line 3 "Start menu folder: " $Application.StartMenuFolder } } If($Application.AddToClientDesktop) { line 2 "Add shortcut to the client's desktop " } #access control properties If($Application.ConnectionsThroughAccessGatewayAllowed) { line 2 "Allow connections made through AGAE : " -nonewline If($Application.ConnectionsThroughAccessGatewayAllowed) { line 0 "Yes" } Else { line 0 "No" } } If($Application.OtherConnectionsAllowed) { line 2 "Any connection : " -nonewline If($Application.OtherConnectionsAllowed) { line 0 "Yes" } Else { line 0 "No" } } 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 "File Type Associations for this application : None" } } Else { line 2 "Unable to retrieve the list of FTAs 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 app 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 1 instance of app for each user : " -NoNewLine If ($Application.MultipleInstancesPerUserAllowed) { line 0 "No" } Else { line 0 "Yes" } If($Application.CpuPriorityLevel) { line 2 "Application importance : " -nonewline switch ($Application.CpuPriorityLevel) { "Unknown" {line 0 "Unknown"} "BelowNormal" {line 0 "Below Normal"} "Low" {line 0 "Low"} "Normal" {line 0 "Normal"} "AboveNormal" {line 0 "Above Normal"} "High" {line 0 "High"} Default {line 0 "Application importance could not be determined: $($Application.CpuPriorityLevel)"} } } #client options properties line 2 "Enable legacy audio : " -nonewline switch ($Application.AudioType) { "Unknown" {line 0 "Unknown"} "None" {line 0 "Not Enabled"} "Basic" {line 0 "Enabled"} Default {line 0 "Enable legacy audio could not be determined: $($Application.AudioType)"} } line 2 "Minimum requirement : " -nonewline If($Application.AudioRequired) { line 0 "Enabled" } Else { line 0 "Disabled" } If($Application.SslConnectionEnable) { line 2 "Enable SSL and TLS protocols : " -nonewline If($Application.SslConnectionEnabled) { line 0 "Enabled" } Else { line 0 "Disabled" } } If($Application.EncryptionLevel) { line 2 "Encryption : " -nonewline switch ($Application.EncryptionLevel) { "Unknown" {line 0 "Unknown"} "Basic" {line 0 "Basic"} "LogOn" {line 0 "128-Bit Login Only (RC-5)"} "Bits40" {line 0 "40-Bit (RC-5)"} "Bits56" {line 0 "56-Bit (RC-5)"} "Bits128" {line 0 "128-Bit (RC-5)"} Default {line 0 "Encryption could not be determined: $($Application.EncryptionLevel)"} } } If($Application.EncryptionRequired) { line 2 "Minimum requirement : " -nonewline If($Application.EncryptionRequired) { line 0 "Enabled" } Else { line 0 "Disabled" } } line 2 "Start app w/o waiting for printer creation : " -NoNewLine #another weird one, if True then this is Disabled If ($Application.WaitOnPrinterCreation) { line 0 "Disabled" } Else { line 0 "Enabled" } #appearance properties If($Application.WindowType) { line 2 "Session window size : " $Application.WindowType } If($Application.ColorDepth) { line 2 "Maximum color quality : " -nonewline switch ($Application.ColorDepth) { "Unknown" {line 0 "Unknown color depth"} "Colors8Bit" {line 0 "256-color (8-bit)"} "Colors16Bit" {line 0 "Better Speed (16-bit)"} "Colors32Bit" {line 0 "Better Appearance (32-bit)"} Default {line 0 "Maximum color quality could not be determined: $($Application.ColorDepth)"} } } If($Application.TitleBarHidden) { line 2 "Hide application title bar : " -nonewline If($Application.TitleBarHidden) { line 0 "Enabled" } Else { line 0 "Disabled" } } If($Application.MaximizedOnStartup) { line 2 "Maximize application at startup : " -nonewline If($Application.MaximizedOnStartup) { line 0 "Enabled" } Else { line 0 "Disabled" } } Write-Output $global:output $global:output = $null $AppServerInfo = $null } } Else { line 0 "Application information could not be retrieved" } $Applications = $null $global:output = $null
Original script output:
Applications: Display name: Desktop Application name (Browser name): Desktop Disable application: True Hide disabled application: True Application description: Application Type: ServerDesktop Folder path: Applications Content Address: Command line: Working directory: Servers: XA65 Workergroups: Users: XA65\Users Client application folder: ClientFolder Add to client's start menu: True Start menu folder: XYZ Add shortcut to the client's desktop: True Allow connections made through AGAE: True Any connection: True No File Type Associations exist for this application 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: Basic Encryption: Basic Start this application without waiting for printers to be created: True Session window size: 1025x768 Maximum color quality: Colors32Bit 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: XA65 Workergroups: Users: XA65\Users Client application folder: 12345678901234567890123456789 Allow connections made through AGAE: True Any connection: True No File Type Associations exist for this application Limit instances allowed to run in server farm: No limit set Allow only one instance of application for each user: False Application importance: High Minimum requirement: Basic Encryption: Bits128 Start this application without waiting for printers to be created: True Session window size: 75% Maximum color quality: Colors32Bit
Updated script output:
Applications: Display name: Desktop Application name : Desktop Disable application : Yes Hide disabled application: Yes Application Type : Server desktop Folder path : Applications Servers: XA65 Users: XA65\Users Client application folder : ClientFolder Add to client's start menu Start menu folder: XYZ Add shortcut to the client's desktop Allow connections made through AGAE : Yes Any connection : Yes File Type Associations for this application : None Limit instances allowed to run in server farm: No limit set Allow only 1 instance of app for each user : No Application importance : Normal Enable legacy audio : Enabled Minimum requirement : Disabled Encryption : Basic Start app w/o waiting for printer creation : Enabled Session window size : 1025x768 Maximum color quality : Better Appearance (32-bit) Display name: Notepad Application name : Notepad Disable application : No Application Type : Installed application Folder path : Applications Command line : c:\windows\system32\notepad.exe Servers: XA65 Users: XA65\Users Client application folder : 12345678901234567890123456789 Allow connections made through AGAE : Yes Any connection : Yes File Type Associations for this application : None Limit instances allowed to run in server farm: No limit set Allow only 1 instance of app for each user : No Application importance : High Enable legacy audio : Enabled Minimum requirement : Disabled Encryption : 128-Bit (RC-5) Start app w/o waiting for printer creation : Enabled Session window size : 75% Maximum color quality : Better Appearance (32-bit)
I don’t have any streamed applications in my lab but a couple of friends who helped test this script did. One of them sent me sample output for streamed apps. I have sanitized his output.
Original script output:
Display name: Webster Template Editor Application name (Browser name): Webster Template Editor Disable application: False Hide disabled application: False Application description: Webster Template Editor Application Type: StreamedToServer Folder path: Applications Content Address: Citrix streaming application profile address: \\fileserver01\citrix$\AppHub\Webster Template Editor\Webster Template Editor.profile Application to launch from the Citrix streaming application profile: Webster Template Editor Extra command line parameters: -p 88228822882288228822882288228822 Users: WEBSTERIT\XenApp.Applications.Webster Client application folder: Webster Start menu folder: Webster Allow connections made through AGAE: True Any connection: True No File Type Associations exist for this application 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: Basic Encryption: Basic Start this application without waiting for printers to be created: True Session window size: 1024x768 Maximum color quality: Colors32Bit Display name: WEB Standalone Solutions Configuration Tool Application name (Browser name): WEB Standalone Solutions Configuration Disable application: False Hide disabled application: True Application description: Application Type: StreamedToServer Folder path: Applications/Sales Tools/WEB Content Address: Citrix streaming application profile address: \\fileserver01\citrix$\AppHub\XenApp\WEB Sales Tools\WEB Sales Tools.profile Application to launch from the Citrix streaming application profile: WEB Standalone Solutions Configuration Tool Extra command line parameters: Users: WEBSTERIT\XenApp.Applications.SalesTools Client application folder: Sales Tools\WEB Allow connections made through AGAE: True Any connection: True No File Type Associations exist for this application 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: Basic Encryption: Basic Start this application without waiting for printers to be created: True Session window size: 1024x768 Maximum color quality: Colors32Bit Display name: WEB Storage Tool Application name (Browser name): WEB Storage Tool Disable application: False Hide disabled application: True Application description: Sales Tool Application Type: StreamedToServer Folder path: Applications/Sales Tools/WEB Content Address: Citrix streaming application profile address: \\fileserver01\citrix$\AppHub\XenApp\WEB Sales Tools\WEB Sales Tools.profile Application to launch from the Citrix streaming application profile: Storage Tool Extra command line parameters: Users: WEBSTERIT\XenApp.Applications.SalesTools Client application folder: Sales Tools\WEB Allow connections made through AGAE: True Any connection: True No File Type Associations exist for this application Limit instances allowed to run in server farm: No limit set Allow only one instance of application for each user: False Application importance: Normal Minimum requirement: None Encryption: Basic Start this application without waiting for printers to be created: True Session window size: 1024x768 Maximum color quality: Colors32Bit
Updated script output:
Display name: Webster Template Editor Application name : Webster Template Editor Disable application : No Application description : Webster Template Editor Application Type : Streamed to server Folder path : Applications Citrix streaming app profile address : \\Fileserver01\citrix$\AppHub\Webster Template Editor\Webster Template Editor.profile App to launch from Citrix stream app profile : Webster Template Editor Extra command line parameters : -p 88228822882288228822882288228822 Users: WEBSTERIT\XenApp.Applications.Webster Client application folder : Webster Allow connections made through AGAE : Yes Any connection : Yes File Type Associations for this application : None Limit instances allowed to run in server farm: No limit set Allow only 1 instance of app for each user : No Application importance : Normal Enable legacy audio : Enabled Minimum requirement : Disabled Encryption : Basic Start app w/o waiting for printer creation : Enabled Session window size : 1024x768 Maximum color quality : Better Appearance (32-bit) Display name: WEB Standalone Solutions Configuration Tool Application name : WEB Standalone Solutions Configuration Disable application : No Application Type : Streamed to server Folder path : Applications/Sales Tools/WEB Citrix streaming app profile address : \\Fileserver01\citrix$\AppHub\XenApp\WEB Sales Tools\WEB Sales Tools.profile App to launch from Citrix stream app profile : WEB Standalone Solutions Configuration Tool Users: WEBSTERIT\XenApp.Applications.SalesTools Client application folder : Sales Tools\WEB Allow connections made through AGAE : Yes Any connection : Yes File Type Associations for this application : None Limit instances allowed to run in server farm: No limit set Allow only 1 instance of app for each user : No Application importance : Normal Enable legacy audio : Enabled Minimum requirement : Disabled Encryption : Basic Start app w/o waiting for printer creation : Enabled Session window size : 1024x768 Maximum color quality : Better Appearance (32-bit) Display name: WEB Storage Tool Application name : WEB Storage Tool Disable application : No Application description : Sales Tool Application Type : Streamed to server Folder path : Applications/Sales Tools/WEB Citrix streaming app profile address : \\Fileserver01\citrix$\AppHub\XenApp\WEB Sales Tools\WEB Sales Tools.profile App to launch from Citrix stream app profile : Storage Tool Users: WEBSTERIT\XenApp.Applications.SalesTools Client application folder : Sales Tools\WEB Allow connections made through AGAE : Yes Any connection : Yes File Type Associations for this application : None Limit instances allowed to run in server farm: No limit set Allow only 1 instance of app for each user : No Application importance : Normal Enable legacy audio : Not Enabled Minimum requirement : Disabled Encryption : Basic Start app w/o waiting for printer creation : Enabled Session window size : 1024x768 Maximum color quality : Better Appearance (32-bit)
There were no changes made to the History node which is actually the Configuration Logging report.
Next is the Load Balancing Policies section. I only had to make one change and that was the Streamed Delivery Protocol.
If($LoadBalancingPolicyConfiguration.StreamingDeliveryProtocolState -eq "Enabled") { line 2 "Set the delivery protocols for applications streamed to client" line 3 "" -nonewline switch ($LoadBalancingPolicyConfiguration.StreamingDeliveryOption) { "Unknown" {line 0 "Unknown"} "ForceServerAccess" {line 0 "Do not allow applications to stream to the client"} "ForcedStreamedDelivery" {line 0 "Force applications to stream to the client"} Default {line 0 "Delivery protocol could not be determined: $($LoadBalancingPolicyConfiguration.StreamingDeliveryOption)"} } } Elseif($LoadBalancingPolicyConfiguration.StreamingDeliveryProtocolState -eq "Disabled") { #In the GUI, if "Set the delivery protocols for applications streamed to client" IS selected AND #"Allow applications to stream to the client or run on a Terminal Server (default)" IS selected #then "Set the delivery protocols for applications streamed to client" is set to Disabled line 2 "Set the delivery protocols for applications streamed to client" line 3 "Allow applications to stream to the client or run on a Terminal Server (default)" } Else { line 2 "Streamed App Delivery is not configured" }
I don’t have any streamed applications in my lab so I have no Before and After output to show.
Next is the Load Evaluators section. The only changes I made in this section were to shorten some of the text so the lines would not wrap and expand the Load Throttling Settings as shown below.
If($LoadEvaluator.LoadThrottlingEnabled) { line 2 "Load Throttling Settings" line 3 "Impact of logons on load: " -nonewline switch ($LoadEvaluator.LoadThrottling) { "Unknown" {line 0 "Unknown"} "Extreme" {line 0 "Extreme"} "High" {line 0 "High (Default)"} "MediumHigh" {line 0 "Medium High"} "Medium" {line 0 "Medium"} "MediumLow" {line 0 "Medium Low"} Default {line 0 "Impact of logons on load could not be determined: $($LoadEvaluator.LoadThrottling)"} } }
Original script output:
Load Evaluators: Name: Advanced Description: Use the Advanced Load Evaluator to limit memory usage, CPU utilization, and page swaps on a server for load management. Built-in Load Evaluator CPU Utilization Settings Report full load when the processor utilization percentage is greater than this value: 90 Report no load when the processor utilization percentage is less than or equal to this value: 10 Load Throttling Settings Impact of logons on load: High Memory Usage Settings Report full load when the memory usage is greater than this value: 90 Report no load when the memory usage is less than or equal to this value: 10 Page Swaps Settings Report full load when the number of page swaps per second is greater than this value: 100 Report no load when the number of page swaps per second is less than or equal to this value: 0 Name: Copy of Default Description: The Default Load Evaluator uses the user session count for its criteria. User created load evaluator Load Throttling Settings Impact of logons on load: High Server User Load Settings Report full load when the number of server users equals: 100 Name: Default Description: The Default Load Evaluator uses the user session count for its criteria. Built-in Load Evaluator Load Throttling Settings Impact of logons on load: High Server User Load Settings Report full load when the number of server users equals: 100
Updated script output:
Load Evaluators: Name: Advanced Description: Use the Advanced Load Evaluator to limit memory usage, CPU utilization, and page swaps on a server for load management. Built-in Load Evaluator CPU Utilization Settings Report full load when the processor utilization % is > than: 90 Report no load when the processor utilization % is <= to : 10 Load Throttling Settings Impact of logons on load: High (Default) Memory Usage Settings Report full load when the memory usage is > than: 90 Report no load when the memory usage is <= to : 10 Page Swaps Settings Report full load when the # of page swaps per second is > than: 100 Report no load when the # of page swaps per second is <= to : 0 Name: Copy of Default Description: The Default Load Evaluator uses the user session count for its criteria. User created load evaluator Load Throttling Settings Impact of logons on load: High (Default) Server User Load Settings Report full load when the # of server users equals: 100 Name: Default Description: The Default Load Evaluator uses the user session count for its criteria. Built-in Load Evaluator Load Throttling Settings Impact of logons on load: High (Default) Server User Load Settings Report full load when the # of server users equals: 100
The next section is Servers. Several changes were made to this section:
- Lined up text
- Removed items that never displayed data
- Logon Control Mode
- Election Preference
I lined up the text to make the output nicer looking. There were a couple of properties that never contained data or were meaningless. For example, is the server a 32-bit or 64-bit server? Pointless since XenApp 6.5 can only be run on a 64-bit server. I removed Server FQDN and the RDP Port Number because they never returned any data.
I changed Logon Control Mode and Election Preference to match what is displayed in AppCenter.
line 2 "Logon Control Mode : " -nonewline switch ($Server.LogOnMode) { "Unknown" {line 0 "Unknown"} "AllowLogOns" {line 0 "Allow logons and reconnections"} "ProhibitNewLogOnsUntilRestart" {line 0 "Prohibit logons until server restart"} "ProhibitNewLogOns " {line 0 "Prohibit logons only"} "ProhibitLogOns " {line 0 "Prohibit logons and reconnections"} Default {line 0 "Logon control mode could not be determined: $($Server.LogOnMode)"} } line 2 "Election Preference : " -nonewline switch ($server.ElectionPreference) { "Unknown" {line 0 "Unknown"} "MostPreferred" {line 0 "Most Preferred"} "Preferred" {line 0 "Preferred"} "DefaultPreference" {line 0 "Default Preference"} "NotPreferred" {line 0 "Not Preferred"} "WorkerMode" {line 0 "Worker Mode"} Default {line 0 "Server election preference could not be determined: $($server.ElectionPreference)"} }
Original script output:
Servers: Name: XA65 Server FQDN: Product: Citrix Presentation Server, Platinum Edition Version: 6.5.6682 Service Pack: 0 Operating System Type: 64 bit IP Address: 192.168.1.200 Logon: Enabled Logon Control Mode: AllowLogOns Product Installation Date: 01/08/2013 23:31:35 Operating System Version: 6.1.7601 Service Pack 1 Zone: Default Zone Election Preference: MostPreferred Folder: Servers Product Installation Path: C:\Program Files (x86)\Citrix\ License Server Name: 192.168.1.100 License Server Port: 27000 ICA Port Number: 1494 Is the Print Spooler on this server healthy: Power Management Control Mode: Normal Published applications: Display name: Desktop Folder path: Applications Display name: Notepad Folder path: Applications Citrix Hotfixes: Hotfix: XA650R01W2K8R2X64033 Installed by: XA65\Administrator Installed date: 01/09/2013 12:20:06 Hotfix type: Hotfix Valid: True Hotfixes replaced: XA650R01W2K8R2X64005 Hotfix: XA650W2K8R2X64R01 Installed by: XA65\Administrator Installed date: 01/09/2013 11:57:37 Hotfix type: HRP Valid: True Hotfixes replaced: <snip>
Updated script output:
Servers: Name: XA65 Product : Citrix Presentation Server Edition : Platinum Version : 6.5.6682 Service Pack : 0 IP Address : 192.168.1.200 Logons : Enabled Logon Control Mode : Allow logons and reconnections Product Installation Date: 01/08/2013 23:31:35 Operating System Version : 6.1.7601 Service Pack 1 Zone : Default Zone Election Preference : Most Preferred Folder : Servers Product Installation Path: C:\Program Files (x86)\Citrix\ License Server Name : 192.168.1.100 License Server Port : 27000 ICA Port Number : 1494 Published applications: Display name: Desktop Folder path : Applications Display name: Notepad Folder path : Applications Citrix Hotfixes: Hotfix : XA650R01W2K8R2X64033 Installed by : XA65\Administrator Installed date : 01/09/2013 12:20:06 Hotfix type : Hotfix Valid : True Hotfixes replaced: XA650R01W2K8R2X64005 Hotfix : XA650W2K8R2X64R01 Installed by : XA65\Administrator Installed date : 01/09/2013 11:57:37 Hotfix type : HRP Valid : True Hotfixes replaced: <snip>
No changes were made to the Worker Groups section.
The only change made to the Zones section is for the Server Election Preference as shown above in the Servers section.
Original script output:
Zones: Zone Name: DEFAULT ZONE Current Data Collector: XA65 Servers in Zone Server Name and Preference: XA65 MostPreferred
Updated script output:
Zones: Zone Name: DEFAULT ZONE Current Data Collector: XA65 Servers in Zone Server Name and Preference: XA65 - Most Preferred
There were several fixes made to the Policies section:
- Policies are now sorted by Type and Priority
- Fixed Policy filters not working
- Fixed date display for Reboot schedule start date
- Fixed time display for:
- Memory optimization schedule
- Reboot schedule time
- Fixed missing policy entries for:
- Memory optimization exclusion list
- Offline app users
- Virtual IP compatibility programs list
- Virtual IP filter adapter addresses programs list
- Virtual IP virtual loopback programs list
- Flash server-side content fetching whitelist
- Printer driver mapping and compatibility
- Users who can shadow other users
- Users who cannot shadow other users
- Client USB device redirection rules
- Figured out how to retrieve all the settings for the Session Printer policy setting
Policies are now sorted by Type and Priority instead of Policy Name. This allows the output to match what is shown in AppCenter.
I found out that the Policy Filter code just did not work. That is now fixed and will handle multiple filters.
$filters = Get-CtxGroupPolicyFilter -PolicyName $Policy.PolicyName -EA 0 If( $? ) { If(![String]::IsNullOrEmpty($filters)) { line 2 "Filter(s):" ForEach($Filter in $Filters) { Line 3 "Filter name : " $filter.FilterName Line 3 "Filter type : " $filter.FilterType Line 3 "Filter enabled: " $filter.Enabled Line 3 "Filter mode : " $filter.Mode Line 3 "Filter value : " $filter.FilterValue Line 3 "" } } Else { line 2 "No filter information" } } Else { Line 2 "Unable to retrieve Filter settings" }
Original script output:
Policies: Policy Name: Every Possible Computer Setting Type: Computer Description: Enabled: True Priority: 2 No filter information Policy Name: Every User Setting Type: User Description: Every user policy setting Enabled: True Priority: 2 No filter information
Updated script output:
Policy Name : Every Possible Computer Setting Type : Computer Description : Enabled : True Priority : 2 Filter(s): Filter name : ServerGroupFilter0 Filter type : WorkerGroup Filter enabled: True Filter mode : Allow Filter value : TestWG Filter name : ServerGroupFilter1 Filter type : WorkerGroup Filter enabled: True Filter mode : Allow Filter value : testwg2 Policy Name : Every User Setting Type : User Description : Every user policy setting Enabled : True Priority : 2 Filter(s): Filter name : ClientNameFilter0 Filter type : ClientName Filter enabled: True Filter mode : Allow Filter value : ClientName Filter name : ClientIPFilter0 Filter type : ClientIP Filter enabled: True Filter mode : Allow Filter value : 192.168.1.1
The date for Reboot schedule start dateis stored as an integer. MBS helped me create a function to convert the integer back to date.
Function ConvertIntegerToDate { #thanks to MBS for helping me on this function Param( [int]$DateAsInteger = 0 ) #this is stored as an integer but is actually a bitmask #01/01/2013 = 131924225 = 11111011101 00000001 00000001 #01/17/2013 = 131924241 = 11111011101 00000001 00010001 # # last 8 bits are the day # previous 8 bits are the month # the rest (up to 16) are the year #convert integer to binary $year = [Math]::Floor( $DateAsInteger / 65536 ) $month = [Math]::Floor( $DateAsInteger / 256 ) % 256 $day = $DateAsInteger % 256 Return "$Month/$Day/$Year" }
Original script output:
Server Settings\Reboot Behavior\Reboot schedule start date - Value: 131924241
Updated script output:
Server Settings\Reboot Behavior\Reboot schedule start date - Date (MM/DD/YYYY): 1/17/2013
Time entries for Memory Optimization Schedule and Reboot Schedule Time are stored as numbers between 0 and 1439. I created a function, with the help of MBS, to convert the numbers into the correct time in AM or PM.
Function ConvertNumberToTime { Param( [int]$val = 0 ) #this is stored as a number between 0 (00:00 AM) and 1439 (23:59 PM) #180 = 3AM #900 = 3PM #1027 = 5:07 PM #[int] (1027/60) = 17 or 5PM #1027 % 60 leaves 7 or 7 minutes #thanks to MBS for the next line $hour = [System.Math]::Floor( ( [int] $val ) / ( [int] 60 ) ) $minute = $val % 60 $Strminute = $minute.ToString() $tempminute = "" If($Strminute.length -lt 2) { $tempMinute = "0" + $Strminute } else { $tempminute = $strminute } $AMorPM = "AM" If($Hour -ge 0 -and $Hour -le 11) { $AMorPM = "AM" } Else { $AMorPM = "PM" If($Hour -ge 12) { $Hour = $Hour - 12 } } line 0 "$($hour):$($tempminute) $($AMorPM)" }
Original script output:
Server Settings\Memory/CPU\Memory optimization schedule: time - Value: 201 Server Settings\Reboot Behavior\Reboot schedule time - Value: 13
Updated script output:
Server Settings\Memory/CPU\Memory optimization schedule: Time (H:MM TT): 3:21 AM Server Settings\Reboot Behavior\Reboot schedule time - Time (H:MM TT): 0:13 AM
Turns out the missing policy entries were stored as arrays. MBS helped me figure this out by looking at one item, OfflineUsers.
$Setting = Get-CtxGroupPolicyConfiguration -PolicyName "Every Possible Computer Setting" $setting PolicyName : Every Possible Computer Setting Type : Computer OfflineUsers : @{State=Enabled; Values=System.Object[]; Path=ServerSettings\OfflineApplications\OfflineUsers}
The Values=System.Object[] means the data is stored in an array. By running the following PowerShell code we can see the data.
PS C:\webster> $array = $Setting.OfflineUsers.Values PS C:\webster> foreach( $element in $array) >> { >> echo $element >> } >> XA65\Anon000 XA65\Anon001 PS C:\webster>
I did that for all the items I thought had missing data:
- Memory optimization exclusion list
- Offline app users
- Virtual IP compatibility programs list
- Virtual IP filter adapter addresses programs list
- Virtual IP virtual loopback programs list
- Flash server-side content fetching whitelist
- Printer driver mapping and compatibility
- Users who can shadow other users
- Users who cannot shadow other users
- Client USB device redirection rules
The PowerShell code is exactly the same for each.
The following items had their values stored as “compact text” and the Citrix XenApp PowerShell SDK supplied the values (most of the time) as shown in the actual policy setting.
- Auto client reconnect logging
- Display mode degrade preference
- Maximum allowed color depth
- ICA keep alives
- Connection access control
- XenApp product model
- CPU management server level
- Memory optimization interval
- Reboot logon disable time
- Reboot warning interval
- Reboot warning start time
- Flash default behavior
- Flash quality adjustment
- Audio quality
- Default printer – Choose client’s default printer:
- Printer auto-creation event log preference
- Auto-create client printers
- Client printer names
- Printer properties retention
- Universal print driver usage
- Universal printing EMF processing mode
- Universal printing image compression limit
- Universal printing preview preference
- Universal printing print quality limit
- SecureICA minimum encryption level
- Use local time of client
- TWAIN compression level
- Progressive compression level
- Lossy compression level
- Session importance
For example, Auto-create client printers has it value stored as one of the following:
- “DoNotAutoCreate”
- “DefaultPrinterOnly”
- “LocalPrintersOnly”
- “AllPrinters”
But the actual text from the policy setting is:
- “Do not auto-create client printers”
- “Auto-create the client’s default printer only”
- “Auto-create local (non-network) client printers only”
- “Auto-create all client printers”
For all the policy settings listed above, the full text as shown in the GUI policy setting is used. This is done with the PowerShell switch statement. For example, using Auto-create client printers:
If($Setting.ClientPrinterAutoCreation.State -ne "NotConfigured") { line 3 "ICA\Printing\Client Printers\Auto-create client printers: " switch ($Setting.ClientPrinterAutoCreation.Value) { "DoNotAutoCreate" {line 4 "Do not auto-create client printers"} "DefaultPrinterOnly" {line 4 "Auto-create the client's default printer only"} "LocalPrintersOnly" {line 4 "Auto-create local (non-network) client printers only"} "AllPrinters" {line 4 "Auto-create all client printers"} Default {line 4 "Auto-create client printers could not be determined: $($Setting.ClientPrinterAutoCreation.Value)"} } }
The Session Printers policy setting was a royal PITA to figure out. Session Printers took over 350 lines of code to break down all the components. Citrix did not document any of the settings so I had to change one item at a time in the GUI and see what value was returned. At least all the Paper Size settings were listed in numerical order! There are 117 paper sizes and I would have gone nuts if I had to figure them out one at a time.
If($Setting.SessionPrinters.State -ne "NotConfigured") { line 3 "ICA\Printing\Session printers:" $valArray = $Setting.SessionPrinters.Values foreach( $printer in $valArray ) { $prArray = $printer.Split( ',' ) foreach( $element in $prArray ) { if( $element.SubString( 0, 2 ) -eq "\\" ) { $index = $element.SubString( 2 ).IndexOf( '\' ) if( $index -ge 0 ) { $server = $element.SubString( 0, $index + 2 ) $share = $element.SubString( $index + 3 ) line 4 "Server : $server" line 4 "Shared Name : $share" } } Else { $tmp = $element.SubString( 0, 4 ) Switch ($tmp) { "copi" { $txt="Count :" $index = $element.SubString( 0 ).IndexOf( '=' ) if( $index -ge 0 ) { $tmp2 = $element.SubString( $index + 1 ) line 4 "$txt $tmp2" } } "coll" { $txt="Collate :" $index = $element.SubString( 0 ).IndexOf( '=' ) if( $index -ge 0 ) { $tmp2 = $element.SubString( $index + 1 ) line 4 "$txt $tmp2" } } "scal" { $txt="Scale (%) :" $index = $element.SubString( 0 ).IndexOf( '=' ) if( $index -ge 0 ) { $tmp2 = $element.SubString( $index + 1 ) line 4 "$txt $tmp2" } } "colo" { $txt="Color :" $index = $element.SubString( 0 ).IndexOf( '=' ) if( $index -ge 0 ) { $tmp2 = $element.SubString( $index + 1 ) line 4 "$txt " -nonewline Switch ($tmp2) { 1 {line 0 "Monochrome"} 2 {line 0 "Color"} Default {line 4 "Color could not be determined: $($element)"} } } } "prin" { $txt="Print Quality:" $index = $element.SubString( 0 ).IndexOf( '=' ) if( $index -ge 0 ) { $tmp2 = $element.SubString( $index + 1 ) line 4 "$txt " -nonewline Switch ($tmp2) { -1 {line 0 "150 dpi"} -2 {line 0 "300 dpi"} -3 {line 0 "600 dpi"} -4 {line 0 "1200 dpi"} Default { line 0 "Custom..." line 4 "X resolution : " $tmp2 } } } } "yres" { $txt="Y resolution :" $index = $element.SubString( 0 ).IndexOf( '=' ) if( $index -ge 0 ) { $tmp2 = $element.SubString( $index + 1 ) line 4 "$txt $tmp2" } } "orie" { $txt="Orientation :" $index = $element.SubString( 0 ).IndexOf( '=' ) if( $index -ge 0 ) { $tmp2 = $element.SubString( $index + 1 ) line 4 "$txt " -nonewline switch ($tmp2) { "portrait" {line 0 "Portrait"} "landscape" {line 0 "Landscape"} Default {line 4 "Orientation could not be determined: $($Element)"} } } } "dupl" { $txt="Duplex :" $index = $element.SubString( 0 ).IndexOf( '=' ) if( $index -ge 0 ) { $tmp2 = $element.SubString( $index + 1 ) line 4 "$txt " -nonewline switch ($tmp2) { 1 {line 0 "Simplex"} 2 {line 0 "Vertical"} 3 {line 0 "Horizontal"} Default {line 4 "Duplex could not be determined: $($Element)"} } } } "pape" { $txt="Paper Size :" $index = $element.SubString( 0 ).IndexOf( '=' ) if( $index -ge 0 ) { $tmp2 = $element.SubString( $index + 1 ) line 4 "$txt " -nonewline switch ($tmp2) { 1 {line 0 "Letter"} 2 {line 0 "Letter Small"} 3 {line 0 "Tabloid"} 4 {line 0 "Ledger"} 5 {line 0 "Legal"} 6 {line 0 "Statement"} 7 {line 0 "Executive"} 8 {line 0 "A3"} 9 {line 0 "A4"} 10 {line 0 "A4 Small"} 11 {line 0 "A5"} 12 {line 0 "B4 (JIS)"} 13 {line 0 "B5 (JIS)"} 14 {line 0 "Folio"} 15 {line 0 "Quarto"} 16 {line 0 "10X14"} 17 {line 0 "11X17"} 18 {line 0 "Note"} 19 {line 0 "Envelope #9"} 20 {line 0 "Envelope #10"} 21 {line 0 "Envelope #11"} 22 {line 0 "Envelope #12"} 23 {line 0 "Envelope #14"} 24 {line 0 "C Size Sheet"} 25 {line 0 "D Size Sheet"} 26 {line 0 "E Size Sheet"} 27 {line 0 "Envelope DL"} 28 {line 0 "Envelope C5"} 29 {line 0 "Envelope C3"} 30 {line 0 "Envelope C4"} 31 {line 0 "Envelope C6"} 32 {line 0 "Envelope C65"} 33 {line 0 "Envelope B4"} 34 {line 0 "Envelope B5"} 35 {line 0 "Envelope B6"} 36 {line 0 "Envelope Italy"} 37 {line 0 "Envelope Monarch"} 38 {line 0 "Envelope Personal"} 39 {line 0 "US Std Fanfold"} 40 {line 0 "German Std Fanfold"} 41 {line 0 "German Legal Fanfold"} 42 {line 0 "B4 (ISO)"} 43 {line 0 "Japanese Postcard"} 44 {line 0 "9X11"} 45 {line 0 "10X11"} 46 {line 0 "15X11"} 47 {line 0 "Envelope Invite"} 48 {line 0 "Reserved - DO NOT USE"} 49 {line 0 "Reserved - DO NOT USE"} 50 {line 0 "Letter Extra"} 51 {line 0 "Legal Extra"} 52 {line 0 "Tabloid Extra"} 53 {line 0 "A4 Extra"} 54 {line 0 "Letter Transverse"} 55 {line 0 "A4 Transverse"} 56 {line 0 "Letter Extra Transverse"} 57 {line 0 "A Plus"} 58 {line 0 "B Plus"} 59 {line 0 "Letter Plus"} 60 {line 0 "A4 Plus"} 61 {line 0 "A5 Transverse"} 62 {line 0 "B5 (JIS) Transverse"} 63 {line 0 "A3 Extra"} 64 {line 0 "A5 Extra"} 65 {line 0 "B5 (ISO) Extra"} 66 {line 0 "A2"} 67 {line 0 "A3 Transverse"} 68 {line 0 "A3 Extra Transverse"} 69 {line 0 "Japanese Double Postcard"} 70 {line 0 "A6"} 71 {line 0 "Japanese Envelope Kaku #2"} 72 {line 0 "Japanese Envelope Kaku #3"} 73 {line 0 "Japanese Envelope Chou #3"} 74 {line 0 "Japanese Envelope Chou #4"} 75 {line 0 "Letter Rotated"} 76 {line 0 "A3 Rotated"} 77 {line 0 "A4 Rotated"} 78 {line 0 "A5 Rotated"} 79 {line 0 "B4 (JIS) Rotated"} 80 {line 0 "B5 (JIS) Rotated"} 81 {line 0 "Japanese Postcard Rotated"} 82 {line 0 "Double Japanese Postcard Rotated"} 83 {line 0 "A6 Rotated"} 84 {line 0 "Japanese Envelope Kaku #2 Rotated"} 85 {line 0 "Japanese Envelope Kaku #3 Rotated"} 86 {line 0 "Japanese Envelope Chou #3 Rotated"} 87 {line 0 "Japanese Envelope Chou #4 Rotated"} 88 {line 0 "B6 (JIS)"} 89 {line 0 "B6 (JIS) Rotated"} 90 {line 0 "12X11"} 91 {line 0 "Japanese Envelope You #4"} 92 {line 0 "Japanese Envelope You #4 Rotated"} 93 {line 0 "PRC 16K"} 94 {line 0 "PRC 32K"} 95 {line 0 "PRC 32K(Big)"} 96 {line 0 "PRC Envelope #1"} 97 {line 0 "PRC Envelope #2"} 98 {line 0 "PRC Envelope #3"} 99 {line 0 "PRC Envelope #4"} 100 {line 0 "PRC Envelope #5"} 101 {line 0 "PRC Envelope #6"} 102 {line 0 "PRC Envelope #7"} 103 {line 0 "PRC Envelope #8"} 104 {line 0 "PRC Envelope #9"} 105 {line 0 "PRC Envelope #10"} 106 {line 0 "PRC 16K Rotated"} 107 {line 0 "PRC 32K Rotated"} 108 {line 0 "PRC 32K(Big) Rotated"} 109 {line 0 "PRC Envelope #1 Rotated"} 110 {line 0 "PRC Envelope #2 Rotated"} 111 {line 0 "PRC Envelope #3 Rotated"} 112 {line 0 "PRC Envelope #4 Rotated"} 113 {line 0 "PRC Envelope #5 Rotated"} 114 {line 0 "PRC Envelope #6 Rotated"} 115 {line 0 "PRC Envelope #7 Rotated"} 116 {line 0 "PRC Envelope #8 Rotated"} 117 {line 0 "PRC Envelope #9 Rotated"} Default {line 4 "Paper Size could not be determined: $($element)"} } } } "form" { $txt="Form Name :" $index = $element.SubString( 0 ).IndexOf( '=' ) if( $index -ge 0 ) { $tmp2 = $element.SubString( $index + 1 ) If($tmp2.length -gt 0) { line 4 "$txt $tmp2" } } } "true" { $txt="TrueType :" $index = $element.SubString( 0 ).IndexOf( '=' ) if( $index -ge 0 ) { $tmp2 = $element.SubString( $index + 1 ) line 4 "$txt " -nonewline switch ($tmp2) { 1 {line 0 "Bitmap"} 2 {line 0 "Download"} 3 {line 0 "Substitute"} 4 {line 0 "Outline"} Default {line 4 "TrueType could not be determined: $($Element)"} } } } "mode" { $txt="Printer Model:" $index = $element.SubString( 0 ).IndexOf( '=' ) if( $index -ge 0 ) { $tmp2 = $element.SubString( $index + 1 ) line 4 "$txt $tmp2" } } "loca" { $txt="Location :" $index = $element.SubString( 0 ).IndexOf( '=' ) if( $index -ge 0 ) { $tmp2 = $element.SubString( $index + 1 ) If($tmp2.length -gt 0) { line 4 "$txt $tmp2" } } } Default {line 4 "Session printer setting could not be determined: $($Element)"} } } } line 0 "" } }
Original script output:
ICA\Printing\Session printers - Value: Enabled
Updated script output:
ICA\Printing\Session printers: Server : \\192.168.1.200 Shared Name : brother Count : 1 Collate : True Scale (%) : 100 Color : Color Print Quality: Custom... X resolution : 148 Y resolution : 248 Orientation : Portrait Duplex : Vertical Paper Size : PRC 32K(Big) TrueType : Substitute Printer Model: Brother HL-5350DN Location : Webster's Lab Server : \\192.168.1.51 Shared Name : bro Form Name : New Form Name Printer Model: Brother HL-6180DW series Server : \\192.168.1.200 Shared Name : hp Paper Size : Quarto Printer Model: HP LaserJet 4100 Series PCL6 Location : Somewhere
The Policies section is over 1500 lines long so you can look at the script itself to see all the changes made.
Original script output:
Policies: Policy Name: Every Possible Computer Setting Type: Computer Description: Enabled: True Priority: 2 No filter information Computer settings: ICA\ICA listener connection timeout - Value: 120000 ICA\ICA listener port number - Value: 1494 ICA\Auto Client Reconnect\Auto client reconnect - Value: Allowed ICA\Auto Client Reconnect\Auto client reconnect logging - Value: DoNotLogAutoReconnectEvents ICA\End User Monitoring\ICA round trip calculation - Value: Enabled ICA\End User Monitoring\ICA round trip calculation interval (Seconds) - Value: 15 ICA\End User Monitoring\ICA round trip calculations for idle connections - Value: Disabled ICA\Graphics\Display memory limit: 32768 ICA\Graphics\Display mode degrade preference: ColorDepth ICA\Graphics\Dynamic Windows Preview: Enabled ICA\Graphics\Image caching - Value: Enabled ICA\Graphics\Maximum allowed color depth: BitsPerPixel32 ICA\Graphics\Notify user when display mode is degraded - Value: Disabled ICA\Graphics\Queueing and tossing - Value: Enabled ICA\Graphics\Caching\Persistent Cache Threshold - Value: 3000000 ICA\Keep ALive\ICA keep alive timeout - Value: 60 ICA\Keep ALive\ICA keep alives - Value: DoNotSendKeepAlives ICA\Multimedia\Multimedia conferencing - Value: Allowed ICA\Multimedia\Windows Media Redirection - Value: Allowed ICA\Multimedia\Windows Media Redirection Buffer Size - Value: 5 ICA\Multimedia\Windows Media Redirection Buffer Size Use - Value: Disabled ICA\MultiStream Connections\Multi-Port Policy - Value: CGP port1: 2600 priority: Very High CGP port2: 2601 priority: Medium CGP port3: 2602 priority: Low ICA\MultiStream Connections\Multi-Stream - Value: Disabled ICA\Security\Prompt for password - Value: Disabled ICA\Server Limits\Server idle timer interval - Value: 0 ICA\Session Reliability\Session reliability connections - Value: Allowed ICA\Session Reliability\Session reliability port number - Value: 2598 ICA\Session Reliability\Session reliability timeout - Value: 180 ICA\Shadowing\Shadowing - Value: Allowed Licensing\License server host name: 192.168.1.100 Licensing\License server port: 27000 Power and Capacity Management\Farm name: PCMFarmName Power and Capacity Management\Workload name: Workload Server Settings\Connection access control - Value: AllowAny Server Settings\DNS address resolution - Value: Disabled Server Settings\Full icon caching - Value: Enabled Server Settings\Load Evaluator Name - Value: Default Server Settings\XenApp product edition - Value: Platinum Server Settings\XenApp product model - Value: XenAppCCU Server Settings\Connection Limits\Limit user sessions - Value: 2147483647 Server Settings\Connection Limits\Limits on administrator sessions - Value: Disabled Server Settings\Connection Limits\Logging of logon limit events - Value: Disabled Server Settings\Health Monitoring and Recovery\Health monitoring - Value: Enabled Server Settings\Health Monitoring and Recovery\Health monitoring tests - Value: Name: Citrix IMA Service test File Location: Citrix\IMATest.exe Description: __Internal_IMAServiceTest__ Interval (seconds): 60 Time-out (seconds): 60 Threshold: 5 Recovery action: AlertOnly Name: Logon Monitor Test File Location: Citrix\LogonMonitor.dll Arguments: /SessionTime:5 /SessionThreshold:50 /SampleInterval:600 Description: __Internal_LogonMonitorTest__ Interval (seconds): 1 Time-out (seconds): 1 Threshold: 5 Recovery action: AlertOnly Name: Ticketing test File Location: Citrix\RequestTicket.exe Description: __Internal_XMLServiceTest__ Interval (seconds): 60 Time-out (seconds): 60 Threshold: 5 Recovery action: RemoveServerFromLoadBalancing Name: Terminal Services test File Location: Citrix\CheckTermSrv.exe Description: __Internal_RDSServiceTest__ Interval (seconds): 60 Time-out (seconds): 30 Threshold: 5 Recovery action: AlertOnly Server Settings\Health Monitoring and Recovery\Maximum percent of servers with logon control - V alue: 10 Server Settings\Memory/CPU\CPU management server level - Value: NoManagement Server Settings\Memory/CPU\Memory optimization - Value: Disabled Server Settings\Memory/CPU\Memory optimization application exclusion list - Value: Server Settings\Memory/CPU\Memory optimization interval - Value: Daily Server Settings\Memory/CPU\Memory optimization schedule: day of month - Value: 1 Server Settings\Memory/CPU\Memory optimization schedule: day of week - Value: Sunday Server Settings\Memory/CPU\Memory optimization schedule: time - Value: 201 Server Settings\Offline Applications\Offline app client trust - Value: Disabled Server Settings\Offline Applications\Offline app event logging - Value: Disabled Server Settings\Offline Applications\Offline app license period - Value: 21 Server Settings\Offline Applications\Offline app users - Value: Server Settings\Reboot Behavior\Reboot custom warning - Value: Disabled Server Settings\Reboot Behavior\Reboot custom warning text - Value: REBOOT WARNING TEXT Server Settings\Reboot Behavior\Reboot logon disable time - Value: Disable60MinutesBeforeReboot Server Settings\Reboot Behavior\Reboot schedule frequency - Value: 7 Server Settings\Reboot Behavior\Reboot schedule randomization interval - Value: 7 Server Settings\Reboot Behavior\Reboot schedule start date - Value: 131924241 Server Settings\Reboot Behavior\Reboot schedule time - Value: 13 Server Settings\Reboot Behavior\Reboot warning interval - Value: Every15Minutes Server Settings\Reboot Behavior\Reboot warning start time - Value: Start60MinutesBeforeReboot Server Settings\Reboot Behavior\Reboot warning to users - Value: Enabled Server Settings\Reboot Behavior\Scheduled reboots - Value: Enabled Virtual IP\Virtual IP adapter address filtering - Value: Disabled Virtual IP\Virtual IP compatibility programs list - Value: Virtual IP\Virtual IP enhanced compatibility - Value: Enabled Virtual IP\Virtual IP filter adapter addresses programs list - Value: Virtual IP\Virtual IP loopback support - Value: Disabled Virtual IP\Virtual IP virtual loopback programs list - Value: XML Service\Trust XML requests - Value: Disabled XML Service\XML service port - Value: 80 Policy Name: Every User Setting Type: User Description: Every user policy setting Enabled: True Priority: 2 No filter information User settings: ICA\Client clipboard redirection - Value: Allowed ICA\Desktop launches - Value: Prohibited ICA\Launching of non-published programs during client connection - Value: Disabled ICA\Adobe Flash Delivery\Flash Redirection\Flash acceleration - Value: Enabled ICA\Adobe Flash Delivery\Flash Redirection\Flash background color list - Values: https://carlwebster.com/ FF0000 https://carlwebster.com/ FF0001 https://carlwebster.com/ FF0002 https://carlwebster.com/ FF0003 ICA\Adobe Flash Delivery\Flash Redirection\Flash backwards compatibility - Value: Enabled ICA\Adobe Flash Delivery\Flash Redirection\Flash default behavior - Value: Enable ICA\Adobe Flash Delivery\Flash Redirection\Flash event logging - Value: Enabled ICA\Adobe Flash Delivery\Flash Redirection\Flash intelligent fallback - Value: Enabled ICA\Adobe Flash Delivery\Flash Redirection\Flash latency threshold - Value: 30 ICA\Adobe Flash Delivery\Flash Redirection\Flash server-side content fetching URL list - Values: http://www.sitetoallow.com/* ICA\Adobe Flash Delivery\Flash Redirection\Flash URL compatibility list - Values: Action: Render On Client URL: http://www.sitetoblock.com/* ICA\Adobe Flash Delivery\Legacy Server Side Optimizations\Flash quality adjustment - Value: Rest rictedBandwidth ICA\Audio\Audio Plug N Play Allowed ICA\Audio\Audio quality - Value: High ICA\Audio\Client audio redirection - Value: Allowed ICA\Audio\Client microphone redirection - Value: Allowed ICA\Bandwidth\Audio redirection bandwidth limit - Value: 64 ICA\Bandwidth\Audio redirection bandwidth limit percent - Value: 64 ICA\Bandwidth\Client USB device redirection bandwidth limit - Value: 64 ICA\Bandwidth\Client USB device redirection bandwidth limit percent - Value: 64 ICA\Bandwidth\Clipboard redirection bandwidth limit - Value: 64 ICA\Bandwidth\Clipboard redirection bandwidth limit percent - Value: 64 ICA\Bandwidth\COM port redirection bandwidth limit - Value: 64 ICA\Bandwidth\COM port redirection bandwidth limit percent - Value: 64 ICA\Bandwidth\File redirection bandwidth limit - Value: 64 ICA\Bandwidth\File redirection bandwidth limit percent - Value: 64 ICA\Bandwidth\HDX MediaStream Multimedia Acceleration bandwidth limit - Value: 64 ICA\Bandwidth\HDX MediaStream Multimedia Acceleration bandwidth limit percent - Value: 64 ICA\Bandwidth\LPT port redirection bandwidth limit - Value: 64 ICA\Bandwidth\LPT port redirection bandwidth limit percent - Value: 64 ICA\Bandwidth\Overall session bandwidth limit - Value: 64 ICA\Bandwidth\Printer redirection bandwidth limit - Value: 64 ICA\Bandwidth\Printer redirection bandwidth limit percent - Value: 64 ICA\Bandwidth\TWAIN device redirection bandwidth limit - Value: 64 ICA\Bandwidth\TWAIN device redirection bandwidth limit percent - Value: 64 ICA\Desktop UI\Desktop wallpaper - Value: Allowed ICA\Desktop UI\Menu animation - Value: Allowed ICA\Desktop UI\View window contents while dragging - Value: Allowed ICA\File Redirection\Auto connect client drives - Value: Enabled ICA\File Redirection\Client drive redirection - Value: Allowed ICA\File Redirection\Client fixed drives - Value: Allowed ICA\File Redirection\Client floppy drives - Value: Allowed ICA\File Redirection\Client network drives - Value: Allowed ICA\File Redirection\Client optical drives - Value: Allowed ICA\File Redirection\Client removable drives - Value: Allowed ICA\File Redirection\Host to client redirection - Value: Disabled ICA\File Redirection\Read-only client drive access - Value: Disabled ICA\File Redirection\Special folder redirection - Value: Allowed ICA\File Redirection\Use asynchronous writes - Value: Disabled ICA\Multi-Stream Connections\Multi-Stream - Value: Disabled ICA\Port Redirection\Auto connect client COM ports - Value: Disabled ICA\Port Redirection\Auto connect client LPT ports - Value: Enabled ICA\Port Redirection\Client COM port redirection - Value: Allowed ICA\Port Redirection\Client LPT port redirection - Value: Allowed ICA\Printing\Client printer redirection - Value: Allowed ICA\Printing\Default printer - Value: DoNotAdjust ICA\Printing\Printer auto-creation event log preference - Value: LogErrorsAndWarnings ICA\Printing\Session printers - Value: Enabled ICA\Printing\Wait for printers to be created (desktop) - Value: Disabled ICA\Printing\Client Printers\Auto-create client printers - Value: LocalPrintersOnly ICA\Printing\Client Printers\Auto-create generic universal printer - Value: ICA\Printing\Client Printers\Client printer names - Value: StandardPrinterNames ICA\Printing\Client Printers\Direct connections to print servers - Value: Enabled ICA\Printing\Client Printers\Printer driver mapping and compatibility - Value: Enabled ICA\Printing\Client Printers\Printer properties retention - Value: FallbackToProfile ICA\Printing\Client Printers\Retained and restored client printers - Value: Allowed ICA\Printing\Drivers\Automatic installation of in-box printer drivers - Value: Enabled ICA\Printing\Drivers\Universal driver preference - Value: PCL5c;PCL4;EMF;XPS;PS ICA\Printing\Drivers\Universal print driver usage - Value: FallbackToSpecific ICA\Printing\Universal Printing\Universal printing EMF processing mode - Value: ReprocessEMFsFor Printer ICA\Printing\Universal Printing\Universal printing image compression limit - Value: LosslessComp ression ICA\Printing\Universal Printing\Universal printing optimization default - Value: ImageCompression=BestQuality HeavyweightCompression=False ImageCaching=True FontCaching=True AllowNonAdminsToModify=True ICA\Printing\Universal Printing\Universal printing preview preference - Value: NoPrintPreview ICA\Printing\Universal Printing\Universal printing print quality limit - Value: HighResolution ICA\Security\SecureICA minimum encryption level - Value: Basic ICA\Session limits\Concurrent logon limit - Value: 0 ICA\Session Limits\Disconnected session timer - Value: Disabled ICA\Session Limits\Disconnected session timer interval - Value: 1440 ICA\Session Limits\Linger Disconnect Timer Interval - Value: 5 ICA\Session Limits\Linger Terminate Timer Interval - Value: 5 ICA\Session Limits\Pre-launch Disconnect Timer Interval - Value: 60 ICA\Session Limits\Pre-launch Terminate Timer Interval - Value: 60 ICA\Session Limits\Session connection timer - Value: Disabled ICA\Session Limits\Session connection timer interval - Value: 1440 ICA\Session Limits\Session idle timer - Value: Enabled ICA\Session Limits\Session idle timer interval - Value: 1440 ICA\Shadowing\Input from shadow connections - Value: Allowed ICA\Shadowing\Log shadow attempts - Value: Enabled ICA\Shadowing\Notify user of pending shadow connections - Value: Enabled ICA\Shadowing\Users who can shadow other users - Value: ICA\Shadowing\Users who cannot shadow other users - Value: ICA\Time Zone Control\Estimate local time for legacy clients - Value: Enabled ICA\Time Zone Control\Use local time of client - Value: UseServerTimeZone ICA\TWAIN devices\Client TWAIN device redirection - Value: Allowed ICA\TWAIN devices\TWAIN compression level - Value: Medium ICA\USB devices\Client USB device redirection - Value: Allowed ICA\USB devices\Client USB device redirection rules - Value: ICA\USB devices\Client USB Plug and Play device redirection - Value: Allowed ICA\Visual Display\Max Frames Per Second - Value: 24 ICA\Visual Display\Moving Images\Progressive compression level - Value: UltraHigh ICA\Visual Display\Moving Images\Progressive compression threshold value - Value: 2147483647 ICA\Visual Display\Still Images\Extra Color Compression - Value: Disabled ICA\Visual Display\Still Images\Extra Color Compression Threshold - Value: 8192 ICA\Visual Display\Still Images\Heavyweight compression - Value: Disabled ICA\Visual Display\Still Images\Lossy compression level - Value: Medium ICA\Visual Display\Still Images\Lossy compression threshold value - Value: 2147483647 Server Session Settings\Session importance - Value: Normal Server Session Settings\Single Sign-On - Value: Enabled Server Session Settings\Single Sign-On central store - Value: abcdefghijklm Policy Name: Unfiltered Type: Computer Description: Enabled: True Priority: 1 No filter information Computer settings: User settings: Policy Name: Unfiltered Type: User Description: Enabled: True Priority: 1 No filter information Computer settings: User settings:
Updated script output:
Policies: Policy Name : Unfiltered Type : Computer Description : Enabled : True Priority : 1 No filter information Computer settings: User settings: Policy Name : Every Possible Computer Setting Type : Computer Description : Enabled : True Priority : 2 Filter(s): Filter name : ServerGroupFilter0 Filter type : WorkerGroup Filter enabled: True Filter mode : Allow Filter value : TestWG Filter name : ServerGroupFilter1 Filter type : WorkerGroup Filter enabled: True Filter mode : Allow Filter value : testwg2 Computer settings: ICA\ICA listener connection timeout - Value (milliseconds): 120000 ICA\ICA listener port number - Value: 1494 ICA\Auto Client Reconnect\Auto client reconnect: Allowed ICA\Auto Client Reconnect\Auto client reconnect logging: Do Not Log auto-reconnect events ICA\End User Monitoring\ICA round trip calculation: Enabled ICA\End User Monitoring\ICA round trip calculation interval - Value (seconds): 15 ICA\End User Monitoring\ICA round trip calculations for idle connections: Disabled ICA\Graphics\Display memory limit - Value (KB): 32768 ICA\Graphics\Display mode degrade preference: Degrade color depth first ICA\Graphics\Dynamic Windows Preview: Enabled ICA\Graphics\Image caching: Enabled ICA\Graphics\Maximum allowed color depth: 32 Bits Per Pixel ICA\Graphics\Notify user when display mode is degraded: Disabled ICA\Graphics\Queueing and tossing: Enabled ICA\Graphics\Caching\Persistent Cache Threshold - Value (Kbps): 3000000 ICA\Keep ALive\ICA keep alive timeout - Value (seconds): 60 ICA\Keep ALive\ICA keep alives - Value: Do not send ICA keep alive messages ICA\Multimedia\Multimedia conferencing: Allowed ICA\Multimedia\Windows Media Redirection: Allowed ICA\Multimedia\Windows Media Redirection Buffer Size - Value (seconds): 5 ICA\Multimedia\Windows Media Redirection Buffer Size Use: Disabled ICA\MultiStream Connections\Multi-Port Policy: CGP port1: 2600 priority: Very High CGP port2: 2601 priority: Medium CGP port3: 2602 priority: Low ICA\MultiStream Connections\Multi-Stream: Disabled ICA\Security\Prompt for password: Disabled ICA\Server Limits\Server idle timer interval - Value (milliseconds): 0 ICA\Session Reliability\Session reliability connections: Allowed ICA\Session Reliability\Session reliability port number - Value: 2598 ICA\Session Reliability\Session reliability timeout - Value (seconds): 180 ICA\Shadowing\Shadowing: Allowed Licensing\License server host name - Value: 192.168.1.100 Licensing\License server port - Value: 27000 Power and Capacity Management\Farm name - Value: PCMFarmName Power and Capacity Management\Workload name - Value: Workload Server Settings\Connection access control - Value: Any connections Server Settings\DNS address resolution: Disabled Server Settings\Full icon caching: Enabled Server Settings\Load Evaluator Name - Load evaluator: Default Server Settings\XenApp product edition - Value: Platinum Server Settings\XenApp product model - Value: XenApp Server Settings\Connection Limits\Limit user sessions - Value: 2147483647 Server Settings\Connection Limits\Limits on administrator sessions: Disabled Server Settings\Connection Limits\Logging of logon limit events: Disabled Server Settings\Health Monitoring and Recovery\Health monitoring: Enabled Server Settings\Health Monitoring and Recovery\Health monitoring tests: Name : Citrix IMA Service test File Location : Citrix\IMATest.exe Description : __Internal_IMAServiceTest__ Interval : 60 Time-out : 60 Threshold : 5 Recovery action: AlertOnly Name : Logon Monitor Test File Location : Citrix\LogonMonitor.dll Arguments : /SessionTime:5 /SessionThreshold:50 /SampleInterval:600 Description : __Internal_LogonMonitorTest__ Interval : 1 Time-out : 1 Threshold : 5 Recovery action: AlertOnly Name : Ticketing test File Location : Citrix\RequestTicket.exe Description : __Internal_XMLServiceTest__ Interval : 60 Time-out : 60 Threshold : 5 Recovery action: RemoveServerFromLoadBalancing Name : Terminal Services test File Location : Citrix\CheckTermSrv.exe Description : __Internal_RDSServiceTest__ Interval : 60 Time-out : 30 Threshold : 5 Recovery action: AlertOnly Server Settings\Health Monitoring and Recovery\Max % of servers with logon control - Value: 10 Server Settings\Memory/CPU\CPU management server level - Value: No CPU utilization management Server Settings\Memory/CPU\Memory optimization: Disabled Server Settings\Memory/CPU\Memory optimization application exclusion list - Values: notepad.exe webster.exe wordpad.exe Server Settings\Memory/CPU\Memory optimization interval - Value: Daily Server Settings\Memory/CPU\Memory optimization schedule: day of month - Value: 1 Server Settings\Memory/CPU\Memory optimization schedule: day of week - Value: Sunday Server Settings\Memory/CPU\Memory optimization schedule: Time (H:MM TT): 3:21 AM Server Settings\Offline Applications\Offline app client trust: Disabled Server Settings\Offline Applications\Offline app event logging: Disabled Server Settings\Offline Applications\Offline app license period - Days: 21 Server Settings\Offline Applications\Offline app users: XA65\Anon000 XA65\Anon001 Server Settings\Reboot Behavior\Reboot custom warning: Disabled Server Settings\Reboot Behavior\Reboot custom warning text - Value: REBOOT WARNING TEXT Server Settings\Reboot Behavior\Reboot logon disable time - Value: Disable 60 minutes before reboot Server Settings\Reboot Behavior\Reboot schedule frequency - Days: 7 Server Settings\Reboot Behavior\Reboot schedule randomization interval - Minutes: 7 Server Settings\Reboot Behavior\Reboot schedule start date - Date (MM/DD/YYYY): 1/17/2013 Server Settings\Reboot Behavior\Reboot schedule time - Time (H:MM TT): 0:13 AM Server Settings\Reboot Behavior\Reboot warning interval - Value: Every 15 Minutes Server Settings\Reboot Behavior\Reboot warning start time - Value: Start 60 Minutes Before Reboot Server Settings\Reboot Behavior\Reboot warning to users: Enabled Server Settings\Reboot Behavior\Scheduled reboots: Enabled Virtual IP\Virtual IP adapter address filtering: Disabled Virtual IP\Virtual IP compatibility programs list - Values: wordpad.exe notepad.exe webster.exe Virtual IP\Virtual IP enhanced compatibility: Enabled Virtual IP\Virtual IP filter adapter addresses programs list - Values: outlook.exe word.exe excel.exe Virtual IP\Virtual IP loopback support: Disabled Virtual IP\Virtual IP virtual loopback programs list - Values: webster.exe notepad.exe wordpad.exe XML Service\Trust XML requests: Disabled XML Service\XML service port - Value: 80 Policy Name : Unfiltered Type : User Description : Enabled : True Priority : 1 No filter information Computer settings: User settings: Policy Name : Every User Setting Type : User Description : Every user policy setting Enabled : True Priority : 2 Filter(s): Filter name : ClientNameFilter0 Filter type : ClientName Filter enabled: True Filter mode : Allow Filter value : ClientName Filter name : ClientIPFilter0 Filter type : ClientIP Filter enabled: True Filter mode : Allow Filter value : 192.168.1.1 User settings: ICA\Client clipboard redirection: Allowed ICA\Desktop launches: Prohibited ICA\Launching of non-published programs during client connection: Disabled ICA\Adobe Flash Delivery\Flash Redirection\Flash acceleration: Enabled ICA\Adobe Flash Delivery\Flash Redirection\Flash background color list - Values: https://carlwebster.com/ FF0000 https://carlwebster.com/ FF0001 https://carlwebster.com/ FF0002 https://carlwebster.com/ FF0003 ICA\Adobe Flash Delivery\Flash Redirection\Flash backwards compatibility: Enabled ICA\Adobe Flash Delivery\Flash Redirection\Flash default behavior - Value: Enable Flash acceleration ICA\Adobe Flash Delivery\Flash Redirection\Flash event logging: Enabled ICA\Adobe Flash Delivery\Flash Redirection\Flash intelligent fallback: Enabled ICA\Adobe Flash Delivery\Flash Redirection\Flash latency threshold - Value (milliseconds): 30 ICA\Adobe Flash Delivery\Flash Redirection\Flash server-side content fetching URL list - Values: http://www.sitetoallow.com/* ICA\Adobe Flash Delivery\Flash Redirection\Flash URL compatibility list: Action: Render On Client URL: http://www.sitetoblock.com/* ICA\Adobe Flash Delivery\Legacy Server Side Optimizations\Flash quality adjustment - Value: Optimize Adobe Flash animation options for low bandwidth connections only ICA\Audio\Audio Plug N Play: Allowed ICA\Audio\Audio quality - Value: High - high definition audio ICA\Audio\Client audio redirection: Allowed ICA\Audio\Client microphone redirection: Allowed ICA\Bandwidth\Audio redirection bandwidth limit - Value (Kbps): 64 ICA\Bandwidth\Audio redirection bandwidth limit percent - Value: 64 ICA\Bandwidth\Client USB device redirection bandwidth limit - Value: 64 ICA\Bandwidth\Client USB device redirection bandwidth limit percent - Value: 64 ICA\Bandwidth\Clipboard redirection bandwidth limit - Value (Kbps): 64 ICA\Bandwidth\Clipboard redirection bandwidth limit percent - Value: 64 ICA\Bandwidth\COM port redirection bandwidth limit - Value (Kbps): 64 ICA\Bandwidth\COM port redirection bandwidth limit percent - Value: 64 ICA\Bandwidth\File redirection bandwidth limit - Value (Kbps): 64 ICA\Bandwidth\File redirection bandwidth limit percent - Value: 64 ICA\Bandwidth\HDX MediaStream Multimedia Acceleration bandwidth limit - Value: 64 ICA\Bandwidth\HDX MediaStream Multimedia Acceleration bandwidth limit percent - Value: 64 ICA\Bandwidth\LPT port redirection bandwidth limit - Value (Kbps): 64 ICA\Bandwidth\LPT port redirection bandwidth limit percent - Value: 64 ICA\Bandwidth\Overall session bandwidth limit - Value (Kbps): 64 ICA\Bandwidth\Printer redirection bandwidth limit - Value (Kbps): 64 ICA\Bandwidth\Printer redirection bandwidth limit percent - Value: 64 ICA\Bandwidth\TWAIN device redirection bandwidth limit - Value (Kbps): 64 ICA\Bandwidth\TWAIN device redirection bandwidth limit percent - Value: 64 ICA\Desktop UI\Desktop wallpaper: Allowed ICA\Desktop UI\Menu animation: Allowed ICA\Desktop UI\View window contents while dragging: Allowed ICA\File Redirection\Auto connect client drives: Enabled ICA\File Redirection\Client drive redirection: Allowed ICA\File Redirection\Client fixed drives: Allowed ICA\File Redirection\Client floppy drives: Allowed ICA\File Redirection\Client network drives: Allowed ICA\File Redirection\Client optical drives: Allowed ICA\File Redirection\Client removable drives: Allowed ICA\File Redirection\Host to client redirection: Disabled ICA\File Redirection\Read-only client drive access: Disabled ICA\File Redirection\Special folder redirection: Allowed ICA\File Redirection\Use asynchronous writes: Disabled ICA\Multi-Stream Connections\Multi-Stream: Disabled ICA\Port Redirection\Auto connect client COM ports: Disabled ICA\Port Redirection\Auto connect client LPT ports: Enabled ICA\Port Redirection\Client COM port redirection: Allowed ICA\Port Redirection\Client LPT port redirection: Allowed ICA\Printing\Client printer redirection: Allowed ICA\Printing\Default printer - Choose client's default printer: Do not adjust the user's default printer ICA\Printing\Printer auto-creation event log preference - Value: Log errors and warnings ICA\Printing\Session printers: Server : \\192.168.1.200 Shared Name : brother Count : 1 Collate : True Scale (%) : 100 Color : Color Print Quality: Custom... X resolution : 148 Y resolution : 248 Orientation : Portrait Duplex : Vertical Paper Size : PRC 32K(Big) TrueType : Substitute Printer Model: Brother HL-5350DN Location : Webster's Lab Server : \\192.168.1.51 Shared Name : bro Form Name : New Form Name Printer Model: Brother HL-6180DW series Server : \\192.168.1.200 Shared Name : hp Paper Size : Quarto Printer Model: HP LaserJet 4100 Series PCL6 Location : Somewhere ICA\Printing\Wait for printers to be created (desktop): ICA\Printing\Client Printers\Auto-create client printers: Auto-create local (non-network) client printers only ICA\Printing\Client Printers\Auto-create generic universal printer: ICA\Printing\Client Printers\Client printer names - Value: Standard printer names ICA\Printing\Client Printers\Direct connections to print servers: Enabled ICA\Printing\Client Printers\Printer driver mapping and compatibility - Value: abc,Allow bcd,Deny cde,UPD_Only xyz,Replace=Brother HL-5350DN ICA\Printing\Client Printers\Printer properties retention - Value: Held in profile only if not saved on client ICA\Printing\Client Printers\Retained and restored client printers: Allowed ICA\Printing\Drivers\Automatic installation of in-box printer drivers: Enabled ICA\Printing\Drivers\Universal driver preference - Value: PCL5c;PCL4;EMF;XPS;PS ICA\Printing\Drivers\Universal print driver usage - Value: Use printer model specific drivers only if universal printing is unavailable ICA\Printing\Universal Printing\Universal printing EMF processing mode - Value: Reprocess EMFs for printer ICA\Printing\Universal Printing\Universal printing image compression limit - Value: Best quality (lossless compression) ICA\Printing\Universal Printing\Universal printing optimization default - Value: ImageCompression=BestQuality HeavyweightCompression=False ImageCaching=True FontCaching=True AllowNonAdminsToModify=True ICA\Printing\Universal Printing\Universal printing preview preference - Value: Do not use print preview for auto-created or generic universal printers ICA\Printing\Universal Printing\Universal printing print quality limit - Value: High Resolution (1200 DPI) ICA\Security\SecureICA minimum encryption level - Value: Basic ICA\Session limits\Concurrent logon limit - Value: 0 ICA\Session Limits\Disconnected session timer: Disabled ICA\Session Limits\Disconnected session timer interval - Value (minutes): 1440 ICA\Session Limits\Linger Disconnect Timer Interval - Value (minutes): 5 ICA\Session Limits\Linger Terminate Timer Interval - Value (minutes): 5 ICA\Session Limits\Pre-launch Disconnect Timer Interval - Value (minutes): 60 ICA\Session Limits\Pre-launch Terminate Timer Interval - Value (minutes): 60 ICA\Session Limits\Session connection timer: Disabled ICA\Session Limits\Session connection timer interval - Value (minutes): 1440 ICA\Session Limits\Session idle timer: Enabled ICA\Session Limits\Session idle timer interval - Value (minutes): 1440 ICA\Shadowing\Input from shadow connections: Allowed ICA\Shadowing\Log shadow attempts: Enabled ICA\Shadowing\Notify user of pending shadow connections: Enabled ICA\Shadowing\Users who can shadow other users - Value: XA65\ANON000 XA65\ANON002 XA65\ANON004 XA65\ANON006 XA65\ANON008 XA65\ANON010 XA65\ANON012 XA65\ANON014 ICA\Shadowing\Users who cannot shadow other users - Value: XA65\ANON001 XA65\ANON003 XA65\ANON005 XA65\ANON007 XA65\ANON009 XA65\ANON011 XA65\ANON013 ICA\Time Zone Control\Estimate local time for legacy clients: Enabled ICA\Time Zone Control\Use local time of client - Value: Use server time zone ICA\TWAIN devices\Client TWAIN device redirection: Allowed ICA\TWAIN devices\TWAIN compression level - Value: Medium ICA\USB devices\Client USB device redirection: Allowed ICA\USB devices\Client USB device redirection rules - Values: Allow: VID=1230 PID=0007 # Another Industries, Another Flash Drive Deny: Class=08 subclass=05 # Mass Storage ICA\USB devices\Client USB Plug and Play device redirection: Allowed ICA\Visual Display\Max Frames Per Second - Value (fps): 24 ICA\Visual Display\Moving Images\Progressive compression level - Value: Ultra high ICA\Visual Display\Moving Images\Progressive compression threshold value - Value (Kbps): 2147483 647 ICA\Visual Display\Still Images\Extra Color Compression: Disabled ICA\Visual Display\Still Images\Extra Color Compression Threshold - Value (Kbps): 8192 ICA\Visual Display\Still Images\Heavyweight compression: Disabled ICA\Visual Display\Still Images\Lossy compression level - Value: Medium ICA\Visual Display\Still Images\Lossy compression threshold value - Value (Kbps): 2147483647 Server Session Settings\Session importance - Value: Normal Server Session Settings\Single Sign-On: Enabled Server Session Settings\Single Sign-On central store - Value: abcdefghijklm
How to use this script?
I saved the script as XA65_Inventory_V2.ps1 in the C:\PSScripts folder. From the PowerShell prompt, change to the C:\PSScripts folder, or the folder where you saved the script. From the PowerShell prompt, type in:
.\XA65_Inventory_V2.ps1 | out-file .\XA65Farm.doc
and press Enter.
Open XA65Farm.doc in either WordPad or Microsoft Word.
The next 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. That version will be a separate script so you don’t have to use that one if you don’t want to. 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/
January 21, 2013
PowerShell, XenApp, XenApp 6.5