I wrote this C# (csharp) function back in 2020 when developing the Self-Service Session Reset Tool. I have since enhanced it for improved error checking and logging and am happy to share it here for anyone else who wants to leverage it. I released a PowerShell version back in 2019. I like to integrate these functions into the scripts and tools I create as part of the health checks I do. I believe that by checking that the Broker’s Registrar service is reachable, listening and processing requests on its configured port, we can only then assume it is in a healthy state.
/Citrix/CdsController/IRegistrar
XDPing PowerShell Function
I wanted to write valid PowerShell function to do an XDPing the same way Citrix do with their Health Assistant tool. I was struggling a little to get the PowerShell code working as expected, so in the end I used the JetBrains dotPeek .NET decompiler to decompile the VDAAssistant.Backend.dll, which is a component of the Citrix Health Assistant Tool. This allowed me to reverse engineer and understand how Citrix does it in C# .NET, which is then easy for me to convert to PowerShell. Yeah…okay, so I cheated at little 😉 I also released a C# (csharp) function I wrote back in 2020.
I used this PowerShell function in two scripts:
- Controlling the Starting of the Citrix Desktop Service (BrokerAgent)
- The Citrix Virtual Apps and Desktops & Desktops as a Service Health Check Script on Steroids
To test if the Broker service is reachable, listening and processing requests on its configured port, you can issue blank HTTP POST requests at the Broker’s Registrar service, which is located at /Citrix/CdsController/IRegistrar. If the first line displayed/returned is “HTTP/1.1 100 Continue“, then the Broker service responded and is deemed to be healthy.