Script Library

Boost your management, troubleshoot, and remediation capabilities with scripts created by experts in the IT community.

<< Back to Script Library

Tag: citrix

(50 Scripts)
Citrix HDX Optimization can improve the user experience for Teams video/audio use.
The optimization will also significantly reduce the resource consumption on the VDA.

Please report any issues and feedback
Version: 2.9.24  |   Created: 2021-01-04  |   Modified: 2021-03-05  |   Creator: Marcel Calef  |   Downloads: 281
Shadows Citrix, VMware, RDSH and WVD sessions
Version: 1.3.13  |   Created: 2020-10-15  |   Modified: 2020-10-20  |   Creator: Trentent Tye  |   Downloads: 135
Performs a test of all the technical requirements for HDX content redirection, which can potentially save bandwidth and CPU. The script’s output provides the test results along with recommendations on components that need to be enabled or upgraded for content redirection to work.
Version: 1.4.20  |   Created: 2020-10-07  |   Modified: 2020-10-13  |   Creator: Marcel Calef  |   Downloads: 74
Run on a Delivery Controller or where the CVAD PowerShell snapins are available, e.g. Studio is installed. User running the script must have sufficient permission to chage the enabled state of the selected delivery groups
Version: 1.1.6  |   Created: 2020-10-06  |   Modified: 2020-10-13  |   Creator: Guy Leech  |   Downloads: 28
Show how recently (in number of days) delivery groups have had sessions launched from them, by checking the last used property for each machine in a delivery group.
Specify the minimum number of days last launched to show only delivery groups which have not had sessions launched within that number of days and optionally disable them. Specify 0 days to show all delivery groups.

Run on a Delivery Controller or where the CVAD PowerShell snapins are available, e.g. Studio is installed.
Version: 2.6.19  |   Created: 2020-10-02  |   Modified: 2020-10-09  |   Creator: Guy Leech  |   Downloads: 33
Query the selected delivery controller via OData to retrieve connection failure details for a specific user, or all users, within a specified number of days ago
Version: 2.4.10  |   Created: 2020-08-05  |   Modified: 2020-12-01  |   Creator: Guy Leech  |   Downloads: 209
There are many situations for which a machine (server OS or workstation) will lose domain trust.
If the ControlUp agent is installed on the machine, this script will execute locally and repair the domain trust. Domain credentials with permission to reset the computer account must be provided.
Version: 1.2.7  |   Created: 2020-05-06  |   Modified: 2020-05-07  |   Creator: marcel.calef  |   Downloads: 143
This Script Action checks if your Citrix ADC appliance is a VPX and if so, changes the cpuyield setting to YES to ensure no High CPU usage is reported on the hypervisor (see https://support.citrix.com/article/CTX229555)

Note: This script only changes the setting on the current ADC and most be performed on both nodes of a HA pair as the setting is node specific and not synchronized.
Version: 1.2.3  |   Created: 2020-01-05  |   Modified: 2020-02-11  |   Creator: ebarthel  |   Downloads: 27
This script creates a video of the entire user display area and saves it in a location of choice. This script requires ffmpeg.exe to be downloaded and placed in an accessible location.
Version: 1.3.4  |   Created: 2019-03-13  |   Modified: 2019-03-27  |   Creator: Ton de Vreede  |   Downloads: 134
This script gets the dimensions of the users working display area and takes screenshots. The screenshots can be saved as a BMP, JPG or PNG in a location of choice.
Version: 1.2.2  |   Created: 2019-03-13  |   Modified: 2019-03-31  |   Creator: Ton de Vreede  |   Downloads: 76
Displays the titles of all visible windows running in the user session
Version: 1.0.1  |   Created: 2019-01-13  |   Modified: 2019-01-13  |   Creator: Guy Leech  |   Downloads: 335
Finds and optionally deletes local user profiles. The user can provide two arguments – the minimum profile age in days and the minimum profile size. The default operation mode is to display the profiles that fit these criteria. When the “Delete” option is set to “true”, the script will delete the profiles it found.
Version: 2.4.20  |   Created: 2018-12-26  |   Modified: 2020-06-10  |   Creator: Guy Leech  |   Downloads: 151
Show the client device Operating System type form for a specific user session.
Use this script without requesting the display of the Receiver version to get the results grouped by client OS (available only as a ControlUp Script Based Action).

Categorization of the Client OS is accomplished by querying the Citrix VDA or XA65 worker for the ClientPlatformId registry value in the appropriate Citrix ICA hive for that user session and follow the conversion described in this document:
https://www.citrix.com/mobilitysdk/docs/clientdetection.html
Version: 2.8.23  |   Created: 2018-12-08  |   Modified: 2018-12-16  |   Creator: Marcel Calef  |   Downloads: 115
Show details for all PVS target devices which are marked as active
Version: 2.3.11  |   Created: 2018-12-06  |   Modified: 2019-04-04  |   Creator: Guy Leech  |   Downloads: 73
This script queries and displays the values of performance counters for the Citrix Federated Authentication Service object. It requires the “CitrixFederatedAuthenticationService” service to exist on the target computer.
Version: 1.0.1  |   Created: 2018-11-29  |   Modified: 2018-11-29  |   Creator: Samuel Legrand  |   Downloads: 42
Citrix Apps and Desktops (formerly XenApp and XenDesktop) introduced Adaptive transport which automatically chooses between TCP & UDP for the HDX sessions. This script will leverage the ctxsession command to display the current status of the active HDX sessions.
Version: 1.10.23  |   Created: 2018-11-19  |   Modified: 2018-12-20  |   Creator: Marcel Calef  |   Downloads: 376
Show the Citrix Director actions performed in a given time window, optionally filtered on a specific user. Use this SBA to see what actions have been taken which might affect end users such as logging them off.
Arguments:
Start – optional time to show actions from. Can be specified as a date/time or as a number of units of time back from the present such as 7d or 1w where s=second,m=minute,h=hour,d=day,w=week,y=year (default is 7 days)
End – time to stop showing actions after. Can be specified either as a date/time or a number of units of time from the start value specified. (default is the current time)
If date/time values are used, they must be enclosed in double quotes, e.g. “02/02/2018 08:00:00”
Username – optional name of a user to just show changes for
Version: 1.4.6  |   Created: 2018-10-29  |   Modified: 2018-11-26  |   Creator: Guy Leech  |   Downloads: 83
Show the configuration changes made in Citrix Studio in a given time window, optionally filtered on a specific user. Use this SBA to see if any changes have been made which might be affecting end users.
Arguments:
Start – optional time to show changes from. Can be specified as a date/time or as a number of units of time back from the present such as 7d or 1w where s=second,m=minute,h=hour,d=day,w=week,y=year (default is 7 days)
End – time to stop showing changes after. Can be specified either as a date/time or a number of units of time from the start value specified. (default is the current time)
If date/time values are used, they must be enclosed in double quotes, e.g. “02/02/2018 08:00:00”
Username – optional name of a user to just show changes for
Version: 1.4.14  |   Created: 2018-10-29  |   Modified: 2018-11-26  |   Creator: Guy Leech  |   Downloads: 88
Recurses AD groups found to show all user accounts with any access to Citrix Studio.
Needs to be run using an account that has at least read-only Studio access.
Use it to see exactly which users have access and what level.
Arguments:
User Name to Query – an optional username or regular expression to restrict the display to

If a name is specified as a parameter then only that account is reported on
Version: 1.6.11  |   Created: 2018-10-24  |   Modified: 2018-11-26  |   Creator: Guy Leech  |   Downloads: 42
Retrieve Citrix Provisioning Services audit events, if auditing has been enabled although it can be enabled by this SBA if required. Use to see what administrative actions were performed in an optional time window, by whom and what was done. It must be run with the credentials of a user who has been granted PVS access.
Arguments:
Enable Auditing – if auditing is not enabled, specifying true for this parameter will enable auditing if the user running the SBA has sufficient privilege.
Start – optional time to show audit events from. Can be specified as a date/time or as a number of units of time back from the present such as 7d or 1w where s=second,m=minute,h=hour,d=day,w=week,y=year
End – optional time to stop showing audit events after. Can be specified either as a date/time or a number of units of time from the start value specified.
If date/time values are used, they must be enclosed in double quotes, e.g. “02/02/2018 08:00:00”
Version: 1.3.6  |   Created: 2018-10-23  |   Modified: 2018-11-26  |   Creator: Guy Leech  |   Downloads: 51
Pull all log separate Citrix StoreFront log files into a single time sorted csv file. You may need to change the StoreFront logging levels first which can be done with the “Show or Change StoreFront Logging” SBA. Use to help diagnose StoreFront issues.
Arguments:
Output csv file – full path to a local or remote file to store the log entries in
Start – optional time to start log export from, e.g. just before the problem started or was reproduced. Can be specified as a date/time or as a number of units of time back from the present such as 7d or 1w where s=second,m=minute,h=hour,d=day,w=week,y=year
End – optional time to stop log export at. Can be specified either as a date/time or a number of units of time from the start value specified.
If date/time values are used, they must be enclosed in double quotes, e.g. “02/02/2018 08:00:00”
Version: 1.3.6  |   Created: 2018-10-23  |   Modified: 2018-11-26  |   Creator: Guy Leech  |   Downloads: 76
Retrieve PVS boot times for a given period from event logs and show them with overall statistics such as fastest, slowest and average boot times. Can help find performance issues. Ensure that each PVS server’s stream service has event logging enabled
Arguments:
Last – report on events created in the last x hours/days/weeks, e.g. 7d for last 7 days or 4w for 4 weeks (default is 7 days)
Version: 1.5.7  |   Created: 2018-10-17  |   Modified: 2018-11-26  |   Creator: Guy Leech  |   Downloads: 125
Query or change the logging levels in Citrix StoreFront.
Enable more verbose logging when troubleshooting potential StoreFront issues but turn the level back to off or error when finished to reduce the impact on CPU and free disk space.
Arguments:
Cluster – ff set to true then all servers in the cluster will be discovered and reported/operated on rather than just the selected computer (default is false)
Trace Level – specify one of: ‘Off’, ‘Error’,’Warning’,’Info’,’Verbose’ or leave empty to query rather than change the current settings (default is empty)
Version: 1.4.14  |   Created: 2018-10-17  |   Modified: 2018-11-26  |   Creator: Guy Leech  |   Downloads: 59
Disconnect or logoff sessions on the selected computer(s) which have been idle in excess of a given period, specified in minutes.
Arguments:
Idle Period – the time in minutes after which a disconnected session will be logged off or disconnected depending on the value for the “Logoff” argument (default is 30 minutes)
Logoff – if true, sessions idle in excess of the idle period will be logged off, otherwise they will be disconnected (default is false so sessions will be disconnected)
Version: 1.5.7  |   Created: 2018-10-13  |   Modified: 2018-11-23  |   Creator: Guy Leech  |   Downloads: 225
Cancels any “Message and Logoff” SBAs which are still running on the selected computer(s) by finding the associated PowerShell process and terminating it.
Arguments:
Cancellation Message – A message to display to the users so they can be informed that they will not be logged off (default is no mesage)
Version: 1.3.3  |   Created: 2018-10-12  |   Modified: 2018-11-23  |   Creator: Guy Leech  |   Downloads: 39
Send a message to all connected sessions and then log them all off after a specified amount of time. The message can be repeated at a specified interval if required.
For instance, a delay of 15 minutes can be set and the users messaged every 5 minutes with the text specified in the “Message Text” argument.
When the configured script timeout of 60 seconds is reached, an error will be displayed but the script will keep running. If you need to cancel the logoff once the script has timed out, run the “Cancel Logoffs” SBA for the same computer(s)
Arguments:
Message Text – The text of the message to display to all connected users on the selected computer(s)
Delay Before Logoff – The period in minutes from when the script is invoked to when all users will be automatically logged off by the SBA
Message Every – how often, in minutes, the same message is displayed to the remaining users. Specify zero or a blank value to not repeat the message after the initial display
Version: 1.3.13  |   Created: 2018-10-12  |   Modified: 2018-11-23  |   Creator: Guy Leech  |   Downloads: 114
Show user name, logon and logoff times of all users who have logged off, or been logged off, the selected computer(s) in the last x hours where x is an argument defaulting to 48. Useful to be able to spot if many users were logged off at a specific time.
Arguments:
Hours back to search – default is 48
User – optional user name to search for otherwise all users will be displayed
Version: 1.5.7  |   Created: 2018-07-18  |   Modified: 2018-11-26  |   Creator: Guy Leech  |   Downloads: 124
Use quser.exe to find disconnected sessions on the chosen computer and order on the most recently disconnected, showing the user’s logon time too.
Arguments:
Hours Back to Check – how far back to look for disconnected sessions so those disconnected before this time will not be included (default is 24 hours)
Version: 1.6.19  |   Created: 2018-07-18  |   Modified: 2018-11-21  |   Creator: Guy Leech  |   Downloads: 81
Get a detailed overview of the most recent logon process for a specific user. This script queries the event log for every major event that relates to the logon process. Use this action to track down which phase is responsible for delays during the logon process. Uses WMI to retrieve pre-Windows logon phase data from Citrix so does not use OData and therefore does not need credentials
Version: 9.23.147  |   Created: 2018-07-02  |   Modified: 2020-09-06  |   Creator: Guy Leech  |   Downloads: 3202
Reset registry key where WEM registry settings are stored.
Version: 1.2.25  |   Created: 2017-07-11  |   Modified: 2019-05-20  |   Creator: timriegler  |   Downloads: 32
The script runs for 20 seconds and measures (once every 2 seconds) the ICA RTT and network latency of the relevant session.
The output shows the session info (username, device name/IP, session name/ID) and 10 reads (once every 2 seconds) of the session’s ICA RTT and network latency in seconds.
Version: 2.2.39  |   Created: 2017-03-20  |   Modified: 2017-04-23  |   Creator: Gadi Feldman  |   Downloads: 903
Resets Citrix Receiver in VDA session. Requires cleanup.exe and selfservice.exe. It can take a little over a minute to run.
* Resetting will delete all apps, desktops, accounts, and configurations, and return Receiver to default settings. It will also close all active sessions. Only reset Citrix Receiver to resolve serious problems.
Version: 2.2.6  |   Created: 2016-08-11  |   Modified: 2017-02-26  |   Creator: David Ott  |   Downloads: 146
This script measures the bandwidth of a given active HDX session, and breaks down the bandwidth consumption into the most useable ICA virtual channels. The output shows the bandwidth usage in kbps (kilobits per second) of each virtual channel and the total session. This version shows only the session output (download), and not the upload.
Version: 1.2.27  |   Created: 2016-06-26  |   Modified: 2016-06-27  |   Creator: Matan Nataf  |   Downloads: 1342
Use this script based action to pull detailed information on the cache usage on Citrix XenDesktop 7.9 and above.
Version: 1.0.1  |   Created: 2016-05-31  |   Modified: 2016-05-31  |   Creator: Andrew Morgan  |   Downloads: 567
Checks the computer registry and displays current ICA Listener binding information – if ICA is enabled, displays the adapters to which ICA is bound
Version: 2.0.3  |   Created: 2016-05-03  |   Modified: 2018-11-05  |   Creator: Trentent Tye  |   Downloads: 64
Gets detailed information on Citrix subcomponents
Version: 1.8.24  |   Created: 2016-04-29  |   Modified: 2017-01-31  |   Creator: Andreas Moe  |   Downloads: 317
The following script runs a report against the PVS farm using the latest PowerShell 7.7 and above PowerShell cmdlets.
Version: 1.0.9  |   Created: 2016-04-13  |   Modified: 2016-04-22  |   Creator: Andrew Morgan  |   Downloads: 291
The script runs on the ControlUp Console computer and initiates an HDX connection against one or more XenApp servers in order to check the server’s health. The script does not perform any actual login activity to the targeted XenApp server.
Version: 1.12.26  |   Created: 2016-03-13  |   Modified: 2016-03-16  |   Creator: Matan Nataf  |   Downloads: 963
This script will check the target computer to see if Citrix’s list of recommended Microsoft patches are installed for Windows Server 2012/2012 R2. This helps with Best Practice baselining.
Version: 3.2.6  |   Created: 2015-10-13  |   Modified: 2019-09-24  |   Creator: Zeev Eisenberg  |   Downloads: 188
Gets the PVS target device retries count via the “Mcli-Get DeviceStatus” PowerShell command. This action should be executed on a PVS server with the MCLI PowerShell snap-in installed.
Version: 1.2.4  |   Created: 2015-08-09  |   Modified: 2015-08-10  |   Creator: Yoni Avital  |   Downloads: 520
A Script to obtain the Pool Non Paged Bytes which ultimately is an indication of the amount of Cache in Ram used by Citrix Provisioning Services.
This script will output the amount of PVS Ram Cache in use. This is done by enumarating the amount of Pool nonPaged Bytes in use, which is a measure of the RamCache. Action should be taken if this figure is close to the amount allocated within PVS. The script also supports examining the PVS configuration of disk cache only.
Version: 2.12.18  |   Created: 2015-03-29  |   Modified: 2015-04-14  |   Creator: Matthew Nichols  |   Downloads: 1121
This disables DEP which is recommended by Citrix.
Version: 1.0.1  |   Created: 2014-08-27  |   Modified: 2014-08-27  |   Creator: jjordan  |   Downloads: 320
Adds the selected XenApp server(s) to a Worker Group
Version: 3.2.13  |   Created: 2013-12-30  |   Modified: 2014-02-18  |   Creator: Zeev Eisenberg  |   Downloads: 182
Disable XenDesktop maintenance mode for the selected computer(s)
Version: 7.10.29  |   Created: 2013-11-24  |   Modified: 2014-02-19  |   Creator: Zeev Eisenberg  |   Downloads: 371
Enable XenDesktop maintenance mode for the selected computer(s). Highlight the target VMs, but run it on the broker for the VMs.
Version: 6.0.8  |   Created: 2013-11-24  |   Modified: 2016-02-22  |   Creator: Zeev Eisenberg  |   Downloads: 385
Remove selected server(s) from the list of servers on which a selected application is published
Version: 2.0.2  |   Created: 2013-11-24  |   Modified: 2014-02-20  |   Creator: Zeev Eisenberg  |   Downloads: 157
Enable XenApp Logon to the selected server
Version: 2.0.2  |   Created: 2013-11-24  |   Modified: 2014-02-19  |   Creator: Zeev Eisenberg  |   Downloads: 507
Disable XenApp Logon to the selected server. This state only persists until the next reboot.
Version: 2.0.4  |   Created: 2013-11-24  |   Modified: 2014-02-19  |   Creator: Zeev Eisenberg  |   Downloads: 529
Changes the XenApp Logon Mode for the selected server. Please enter one of the following states: AllowLogOns, ProhibitNewLogOnsUntilRestart, ProhibitNewLogOns, ProhibitLogOns
Version: 4.1.7  |   Created: 2013-11-21  |   Modified: 2017-11-14  |   Creator: Zeev Eisenberg  |   Downloads: 211
Removes the selected XenApp server(s) from a Worker Group
Version: 2.0.3  |   Created: 2013-11-21  |   Modified: 2014-02-20  |   Creator: Zeev Eisenberg  |   Downloads: 163