Free read-only health check scripts for Citrix and Azure Virtual Desktop
The pack contains a Citrix health check PowerShell script and nine Azure Virtual Desktop KQL queries. Every file is read-only and comes from a published Sessionright guide.
What is in the pack
Download free Citrix PowerShell health checks and Azure Virtual Desktop KQL queries. Read-only files from published guides, with run instructions.
| File | What it checks | Source guide |
|---|---|---|
citrix/Invoke-CitrixHealthCheck.ps1 | 15 read-only checks for Citrix Virtual Apps and Desktops and Citrix DaaS, built on documented SDK cmdlets and written to one colour-coded HTML report. | Citrix health check PowerShell script |
avd/kql/billed-mb-per-counter.kql | Records and billed megabytes per performance counter over the last day, for the session hosts you name. | AVD monitoring guide |
avd/kql/latest-unavailable-host-status.kql | The latest health status from the last 30 minutes for every session host that is not Available, with component versions and session counts. | AVD monitoring guide |
avd/kql/completed-without-connecting.kql | Connection attempts in the last day that reached Completed without ever reaching Connected, joined to their errors. | AVD monitoring guide |
avd/kql/error-trends.kql | Errors in the last day counted by error code, source and the ServiceError flag, with the number of users affected. | AVD monitoring guide |
avd/kql/autoscale-evaluations.kql | Every pooled autoscale evaluation in the last day: phase, result, session and host counts and the scaling reason. | AVD scaling plan guide |
avd/kql/autoscale-failures.kql | Autoscale evaluations that did not succeed, joined to their errors. | AVD scaling plan guide |
avd/kql/hosts-not-available-last-day.kql | Each session host's latest health status from the last day where it is not Available, with its last heartbeat. | AVD session host unavailable |
avd/kql/connection-errors-by-user-count.kql | The ten connection errors that affect the most users, limited to errors where ServiceError is false. | AVD no available resources |
avd/kql/fslogix-event-counts.kql | FSLogix Operational and Admin event IDs counted per host over the last day, with the last time each was seen. | FSLogix event ID 26 |
How to run the Citrix health check script
Read every file before you run it. Use the built-in Read Only Administrator role, scoped to everything you want to check.
On CVAD, use Windows PowerShell on a Delivery Controller or a machine with Studio installed. The SDK supports PowerShell 3 through 5.
On DaaS, install the Remote PowerShell SDK on a domain-joined machine in the resource location, never on a Cloud Connector, on-premises Delivery Controller or Studio machine. Install Edge WebView2, use PowerShell 3.0 to 7.0 and remove the CVAD SDK first if installed. The installer adds .NET Framework 4.8 if needed.
From the pack's citrix folder, unblock the downloaded file with Unblock-File. On CVAD, replace the example Controller name with your own. On DaaS, run Get-XdAuthentication first, then use -Mode DaaS. Open the local HTML report named in the last output line.
Unblock-File .\Invoke-CitrixHealthCheck.ps1
.\Invoke-CitrixHealthCheck.ps1 -AdminAddress ddc01.corp.exampleGet-XdAuthentication
.\Invoke-CitrixHealthCheck.ps1 -Mode DaaSRead the Citrix script guide for prerequisites, parameters and report statuses.
How to run the KQL queries
Open Logs in the Log Analytics workspace receiving your AVD diagnostics, paste a .kql file and run the query. Performance queries also need performance counters; the FSLogix query needs the Operational and Admin event logs. Replace example host names with your own. Queries cannot report on data that has not been collected.
What the scripts do not do
The scripts change nothing in your estate. The Citrix script writes one local HTML report and is built on documented SDK cmdlets. These snapshots are not a full assessment and do not fix problems or continuously monitor hosts. DaaS skips the five Controller and site checks because those cmdlets are disabled remotely.
For an Azure Virtual Desktop estate report, the free read-only AVD assessment runs in Azure Cloud Shell and writes a local HTML report.
Health check script questions
Is the Citrix health check script free?
Yes. The Citrix PowerShell script and all ten KQL queries are free under the MIT license. Each file comes from a published Sessionright guide.
Does the script change anything?
It makes no changes to your estate. The Citrix script uses read-only Citrix cmdlets and writes one local HTML report. The KQL files only query log data. Read every file before you run it.
Does it work with Citrix DaaS?
Use the Remote PowerShell SDK on a domain-joined machine in your resource location, authenticate with Get-XdAuthentication, then run the script with -Mode DaaS. Do not install the SDK on a Cloud Connector. The five Controller and site checks are skipped in DaaS.
Why do you ask for an email address?
We send the download link to that address and add it to our contact list. After that we send occasional emails about script updates and Sessionright. Reply to stop.
Where do the AVD KQL queries run?
Run them in Logs in the Log Analytics workspace receiving your AVD diagnostics. Performance counters and FSLogix event logs need their own collection settings, described in the source guides.
Citrix, NetScaler and Citrix Aidrien are trademarks of Cloud Software Group, Inc. Microsoft, Azure and Azure Virtual Desktop are trademarks of the Microsoft group of companies. Sessionright is not affiliated with or endorsed by them.